Mixer: Tweak meter appearance to look better with light color schemes.

This commit is contained in:
Jonathan Moore Liles 2020-10-18 21:05:09 -07:00
parent b1d59fc68a
commit 13c107ebcc
3 changed files with 30 additions and 22 deletions

View File

@ -51,7 +51,7 @@ DPM::DPM ( int X, int Y, int W, int H, const char *L ) :
dim( 0.85f ); dim( 0.85f );
box( FL_FLAT_BOX ); box( FL_NO_BOX );
color( fl_color_average( FL_BLACK, FL_BACKGROUND_COLOR, 0.66f ) ); color( fl_color_average( FL_BLACK, FL_BACKGROUND_COLOR, 0.66f ) );
/* initialize gradients */ /* initialize gradients */
@ -136,10 +136,14 @@ DPM::resize ( int X, int Y, int W, int H )
void DPM::bbox ( int &X, int &Y, int &W, int &H ) void DPM::bbox ( int &X, int &Y, int &W, int &H )
{ {
X = x() + 2; /* X = x() + 2; */
Y = y() + 2; /* Y = y() + 2; */
W = w() - 4; /* W = w() - 4; */
H = h() - 4; /* H = h() - 4; */
X = x();
Y = y();
W = w();
H = h();
} }
void void
@ -151,6 +155,9 @@ DPM::draw ( void )
int X,Y,W,H; int X,Y,W,H;
bbox(X,Y,W,H); bbox(X,Y,W,H);
if ( 0 == fl_not_clipped(X,Y,W,H ) )
return;
int v = pos( value() ); int v = pos( value() );
int pv = pos( peak() ); int pv = pos( peak() );
@ -165,9 +172,9 @@ DPM::draw ( void )
{ {
draw_label(); draw_label();
draw_box( FL_FLAT_BOX, x(), y(), w(), h(), FL_DARK1 ); draw_box( FL_FLAT_BOX, X, Y, W, H, FL_BACKGROUND_COLOR );
} }
fl_push_clip( X, Y, W, H ); fl_push_clip( X, Y, W, H );
const int active = active_r(); const int active = active_r();
@ -221,7 +228,7 @@ DPM::draw ( void )
if ( type() == FL_HORIZONTAL ) if ( type() == FL_HORIZONTAL )
{ {
xx = X + p * bw; xx = X + p * bw;
fl_rectf( X + (p * bw), Y, bw, H, c ); fl_rectf( xx, Y, bw, H, c );
} }
else else
{ {
@ -229,19 +236,19 @@ DPM::draw ( void )
fl_rectf( X, yy, W, bh, c ); fl_rectf( X, yy, W, bh, c );
} }
if ( _pixels_per_segment >= 3 ) /* if ( _pixels_per_segment >= 3 ) */
{ /* { */
fl_color( FL_DARK1 ); /* fl_color( FL_DARK1 ); */
if ( type() == FL_HORIZONTAL ) /* if ( type() == FL_HORIZONTAL ) */
{ /* { */
fl_line( xx, Y, xx, Y + H - 1 ); /* fl_line( xx, Y, xx, Y + H - 1 ); */
} /* } */
else /* else */
{ /* { */
fl_line( X, yy, X + W - 1, yy ); /* fl_line( X, yy, X + W - 1, yy ); */
} /* } */
} /* } */
/* } */ /* } */
/* else */ /* else */

View File

@ -102,6 +102,6 @@ public:
} }
for ( int i = 0; i < 128; i++ ) for ( int i = 0; i < 128; i++ )
_dim_gradient[ i ] = fl_color_average( bc, _gradient[ i ], _dim ); _dim_gradient[ i ] = fl_color_average( FL_BLACK, _gradient[ i ], _dim );
} }
}; };

View File

@ -57,7 +57,8 @@ Meter_Indicator_Module::Meter_Indicator_Module ( bool is_default )
dpm_pack->color( FL_BACKGROUND_COLOR ); dpm_pack->color( FL_BACKGROUND_COLOR );
dpm_pack->box( FL_FLAT_BOX ); dpm_pack->box( FL_FLAT_BOX );
dpm_pack->type( FL_HORIZONTAL ); dpm_pack->type( FL_HORIZONTAL );
dpm_pack->spacing(1);
end(); end();
control_value = new float[1]; control_value = new float[1];