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

pull/119/merge
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 );
box( FL_FLAT_BOX );
box( FL_NO_BOX );
color( fl_color_average( FL_BLACK, FL_BACKGROUND_COLOR, 0.66f ) );
/* 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 )
{
X = x() + 2;
Y = y() + 2;
W = w() - 4;
H = h() - 4;
/* X = x() + 2; */
/* Y = y() + 2; */
/* W = w() - 4; */
/* H = h() - 4; */
X = x();
Y = y();
W = w();
H = h();
}
void
@ -151,6 +155,9 @@ DPM::draw ( void )
int X,Y,W,H;
bbox(X,Y,W,H);
if ( 0 == fl_not_clipped(X,Y,W,H ) )
return;
int v = pos( value() );
int pv = pos( peak() );
@ -165,9 +172,9 @@ DPM::draw ( void )
{
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 );
const int active = active_r();
@ -221,7 +228,7 @@ DPM::draw ( void )
if ( type() == FL_HORIZONTAL )
{
xx = X + p * bw;
fl_rectf( X + (p * bw), Y, bw, H, c );
fl_rectf( xx, Y, bw, H, c );
}
else
{
@ -229,19 +236,19 @@ DPM::draw ( void )
fl_rectf( X, yy, W, bh, c );
}
if ( _pixels_per_segment >= 3 )
{
fl_color( FL_DARK1 );
/* if ( _pixels_per_segment >= 3 ) */
/* { */
/* fl_color( FL_DARK1 ); */
if ( type() == FL_HORIZONTAL )
{
fl_line( xx, Y, xx, Y + H - 1 );
}
else
{
fl_line( X, yy, X + W - 1, yy );
}
}
/* if ( type() == FL_HORIZONTAL ) */
/* { */
/* fl_line( xx, Y, xx, Y + H - 1 ); */
/* } */
/* else */
/* { */
/* fl_line( X, yy, X + W - 1, yy ); */
/* } */
/* } */
/* } */
/* else */

View File

@ -102,6 +102,6 @@ public:
}
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->box( FL_FLAT_BOX );
dpm_pack->type( FL_HORIZONTAL );
dpm_pack->spacing(1);
end();
control_value = new float[1];