Browse Source

Mixer: Tweak appearance.

tags/non-daw-v1.2.0
Jonathan Moore Liles 10 years ago
parent
commit
3fad04c2d5
4 changed files with 32 additions and 15 deletions
  1. +14
    -4
      FL/focus_frame.C
  2. +1
    -1
      FL/focus_frame.H
  3. +2
    -3
      mixer/src/Mixer_Strip.C
  4. +15
    -7
      mixer/src/Module.C

+ 14
- 4
FL/focus_frame.C View File

@@ -27,13 +27,13 @@ draw_focus_frame ( int x, int y, int w, int h, Fl_Color c )

// fl_color( fl_color_average( FL_GRAY, c, 0.50 ) );
fl_color( fl_color_add_alpha( c, 100 ) );
/* fl_color( fl_color_add_alpha( c, 100 ) ); */

fl_line_style( FL_DASH, 2 );
/* fl_line_style( FL_DASH, 2 ); */

fl_rect( x, y, w, h );
/* fl_rect( x, y, w, h ); */

fl_line_style( FL_SOLID, 2 );
fl_line_style( FL_SOLID, 3 );

fl_color( c );

@@ -55,3 +55,13 @@ draw_focus_frame ( int x, int y, int w, int h, Fl_Color c )

fl_pop_clip();
}

bool
focused_r ( Fl_Widget *w )
{
for ( Fl_Widget *p = Fl::focus(); p; p = p->parent() )
if ( p == w )
return true;
return false;
}

+ 1
- 1
FL/focus_frame.H View File

@@ -19,4 +19,4 @@

void
draw_focus_frame ( int x, int y, int w, int h, Fl_Color c );
bool focused_r ( Fl_Widget *w );

+ 2
- 3
mixer/src/Mixer_Strip.C View File

@@ -518,8 +518,7 @@ Mixer_Strip::update ( void )
void
Mixer_Strip::init ( )
{
selection_color( FL_MAGENTA );

selection_color( FL_YELLOW );
_manual_connection = 0;
_auto_input = 0;
_mute_controller_mode = 0;
@@ -754,7 +753,7 @@ Mixer_Strip::draw ( void )
// if ( damage() & ~FL_DAMAGE_USER1 )
Fl_Group::draw();

if ( Fl::focus() == this )
if ( focused_r( this ) )
draw_focus_frame( x(),y(),w(),h(), Fl_Group::selection_color() );
/* else */
/* clear_focus_frame( x(),y(),w(),h(), FL_BACKGROUND_COLOR ); */


+ 15
- 7
mixer/src/Module.C View File

@@ -139,9 +139,10 @@ Module::init ( void )
labeltype( FL_NO_LABEL );
align( FL_ALIGN_CENTER | FL_ALIGN_INSIDE );
set_visible_focus();
selection_color( FL_MAGENTA );
selection_color( FL_YELLOW );

labelsize(12);
color( fl_color_average( FL_WHITE, FL_CYAN, 0.40 ) );
color( fl_rgb_color( 122,190,200 ) );
tooltip( "Left click to edit parameters; Ctrl + left click to select; right click or MENU key for menu." );
}

@@ -616,8 +617,6 @@ Module::draw_box ( int tx, int ty, int tw, int th )

Fl_Color c = color();

c = active() && ! bypass() ? c : FL_GRAY;

if ( ! active_r() )
c = fl_inactive( c );

@@ -648,7 +647,7 @@ Module::draw_box ( int tx, int ty, int tw, int th )

fl_pop_clip();

if ( this == Fl::focus() )
if ( focused_r( this ) )
draw_focus_frame( tx,ty,tw,th, selection_color() );

fl_pop_clip();
@@ -664,9 +663,9 @@ Module::draw_label ( int tx, int ty, int tw, int th )

char *lab = strdup( label() );

Fl_Color c = fl_contrast( FL_FOREGROUND_COLOR, bypass() ? FL_BLACK : color() );
Fl_Color c = fl_contrast( FL_FOREGROUND_COLOR, color() );

fl_color( active_r() ? c : fl_inactive(c) );
fl_color( active_r() && ! bypass() ? c : fl_inactive(c) );

fl_font( FL_HELVETICA, labelsize() );

@@ -717,6 +716,15 @@ Module::draw_label ( int tx, int ty, int tw, int th )
}

fl_draw( s ? s : lab, tx, ty, tw, th, align() | FL_ALIGN_CLIP );
if ( bypass() )
{
fl_color( fl_color_add_alpha( fl_color(), 127 ) );
fl_line_style( FL_SOLID, 2 );
fl_line( tx, ty + th * 0.5, tx + tw, ty + th * 0.5 );
fl_line_style( FL_SOLID, 0 );
}


free(lab);



Loading…
Cancel
Save