From 0e467993a299724240f285ba3de91cc64590aae9 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Fri, 15 Mar 2013 17:49:17 -0700 Subject: [PATCH] Mixer: Tweak module appearance. --- mixer/src/Chain.C | 3 +-- mixer/src/Controller_Module.C | 4 ++-- mixer/src/DPM.C | 2 +- mixer/src/Meter_Module.C | 2 +- mixer/src/Module.C | 21 ++++++--------------- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/mixer/src/Chain.C b/mixer/src/Chain.C index 785b47f..a581c6b 100644 --- a/mixer/src/Chain.C +++ b/mixer/src/Chain.C @@ -508,7 +508,6 @@ Chain::add ( Controller_Module *m ) bool Chain::insert ( Module *m, Module *n ) { - engine()->lock(); if ( !m ) @@ -614,7 +613,7 @@ Chain::draw_connections ( Module *m ) fl_push_clip( X, Y, W, H ); - Fl_Color c =fl_color_average( FL_WHITE, FL_YELLOW, 0.50 ); + Fl_Color c = FL_FOREGROUND_COLOR; fl_color( c ); if ( m->ninputs() ) diff --git a/mixer/src/Controller_Module.C b/mixer/src/Controller_Module.C index 37d5972..8db6fc1 100644 --- a/mixer/src/Controller_Module.C +++ b/mixer/src/Controller_Module.C @@ -362,8 +362,8 @@ Controller_Module::connect_to ( Port *p ) w = o; o->type(4); - o->color(FL_BACKGROUND_COLOR); - o->selection_color((Fl_Color)1); + o->color(FL_DARK1); + o->selection_color(FL_RED); o->minimum(1.5); o->maximum(0); o->value(1); diff --git a/mixer/src/DPM.C b/mixer/src/DPM.C index 92a694d..d67de7a 100644 --- a/mixer/src/DPM.C +++ b/mixer/src/DPM.C @@ -49,7 +49,7 @@ DPM::DPM ( int X, int Y, int W, int H, const char *L ) : // resize( X, Y, W, H ); - dim( 0.70f ); + dim( 0.85f ); /* initialize gradients */ if ( DPM::_gradient[ 0 ] == 0 ) diff --git a/mixer/src/Meter_Module.C b/mixer/src/Meter_Module.C index bb37c3e..3c43807 100644 --- a/mixer/src/Meter_Module.C +++ b/mixer/src/Meter_Module.C @@ -39,7 +39,7 @@ const float METER_UPDATE_FREQ = 0.2f; Meter_Module::Meter_Module ( ) : Module ( 50, 100, name() ) { - box( FL_THIN_UP_FRAME ); + box( FL_NO_BOX ); dpm_pack = new Fl_Scalepack( x(), y(), w(), h() ); dpm_pack->type( FL_HORIZONTAL ); diff --git a/mixer/src/Module.C b/mixer/src/Module.C index e4d7cf4..a889f6f 100644 --- a/mixer/src/Module.C +++ b/mixer/src/Module.C @@ -128,7 +128,7 @@ Module::init ( void ) labeltype( FL_NO_LABEL ); set_visible_focus(); selection_color( FL_RED ); - color( fl_color_average( FL_GREEN, FL_GRAY, 0.4 ) ); + color( fl_color_average( FL_WHITE, FL_CYAN, 0.40 ) ); } @@ -575,20 +575,16 @@ Module::draw_label ( void ) const char *lp = label(); - int l = strlen( label() ); + fl_color( fl_contrast( FL_FOREGROUND_COLOR, bypass() ? FL_BLACK : color() ) ); - Fl_Color c = FL_FOREGROUND_COLOR; + fl_font( FL_HELVETICA, 12 ); - if ( bypass() || ! active() ) - c = FL_BLACK; - - fl_color( fl_contrast( c, is_default() ? FL_BLACK : color() ) ); + int LW = fl_width( lp ); char *s = NULL; - - if ( l > 10 ) + if ( LW > tw ) { - s = new char[l]; + s = new char[strlen(lp)]; char *sp = s; for ( ; *lp; ++lp ) @@ -603,11 +599,6 @@ Module::draw_label ( void ) } - if ( l > 20 ) - fl_font( FL_HELVETICA, 10 ); - else - fl_font( FL_HELVETICA, 14 ); - fl_draw( s ? s : lp, tx, ty, tw, th, (Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP ) ); if ( s )