Darken inactive objects on the timeline.

This commit is contained in:
Jonathan Moore Liles 2008-04-25 01:58:08 -05:00
parent 63ebacb872
commit 4bee9a7053
4 changed files with 28 additions and 11 deletions

View File

@ -159,12 +159,16 @@ Control_Sequence::draw ( void )
fl_clip_box( bx, by, bw, bh, X, Y, W, H );
const Fl_Color color = active_r() ? this->color() : fl_inactive( this->color() );
const Fl_Color selection_color = active_r() ? this->selection_color() : fl_inactive( this->selection_color() );
if ( draw_with_gradient )
{
// Fl_Color target = fl_color_average( color(), FL_WHITE, 0.50f );
// Fl_Color target = fl_color_average( color, FL_WHITE, 0.50f );
const Fl_Color c2 = fl_color_average( selection_color(), FL_WHITE, 0.75f );
const Fl_Color c1 = fl_color_average( color(), c2, 0.60f );
const Fl_Color c2 = fl_color_average( selection_color, FL_WHITE, 0.75f );
const Fl_Color c1 = fl_color_average( color, c2, 0.60f );
for ( int gy = 0; gy < bh; gy++ )
{
@ -175,7 +179,7 @@ Control_Sequence::draw ( void )
if ( draw_with_grid )
{
fl_color( fl_darker( color() ) );
fl_color( fl_darker( color ) );
const int inc = bh / 10;
if ( inc )
@ -191,7 +195,7 @@ Control_Sequence::draw ( void )
draw_curve( draw_with_gradient, true );
fl_end_complex_polygon();
fl_color( selection_color() );
fl_color( selection_color );
fl_line_style( FL_SOLID, 2 );
fl_begin_line();
@ -200,8 +204,8 @@ Control_Sequence::draw ( void )
}
else
{
// fl_color( fl_color_average( selection_color(), color(), 0.70f ) );
fl_color( selection_color() );
// fl_color( fl_color_average( selection_color, color, 0.70f ) );
fl_color( selection_color );
fl_line_style( FL_SOLID, 2 );
fl_begin_line();
@ -211,7 +215,7 @@ Control_Sequence::draw ( void )
fl_line_style( FL_SOLID, 0 );
timeline->draw_measure_lines( x(), y(), w(), h(), color() );
timeline->draw_measure_lines( x(), y(), w(), h(), color );
if ( _highlighted )
for ( list <Sequence_Widget *>::const_iterator r = _widgets.begin(); r != _widgets.end(); r++ )

View File

@ -361,7 +361,7 @@ Loggable::compact ( void )
snapshot( _fp );
_undo_index = 0;
_undo_index = 1;
}

View File

@ -548,11 +548,22 @@ Region::draw_box( void )
fl_push_clip( x(), y(), w(), h() );
int active = active_r();
Fl_Color selection_color = _selection_color;
Fl_Color color = _box_color;
if ( ! active_r() )
{
color = fl_inactive( color );
selection_color = fl_inactive( selection_color );
}
if ( selected() )
fl_draw_box( fl_down( box() ), x() - 10, y(), w() + 50, h(), _selection_color );
fl_draw_box( fl_down( box() ), x() - 10, y(), w() + 50, h(), selection_color );
// fl_draw_box( fl_down( box() ), x() - 10, Y, w() + 50, H, fl_invert_color( _box_color ) );
else
fl_draw_box( box(), x() - 10, y(), w() + 50, h(), _box_color );
fl_draw_box( box(), x() - 10, y(), w() + 50, h(), color );
/* draw fades */
draw_fade( _fade_in, Fade::In, false, x(), w() );

View File

@ -308,6 +308,8 @@ public:
void start ( nframes_t v ) { _r->start = v; }
nframes_t start ( void ) const { return _r->start; }
int active_r ( void ) const { return _track->active_r(); }
virtual nframes_t length ( void ) const { return _r->end - _r->start; }
virtual Fl_Boxtype box ( void ) const { return FL_UP_BOX; }