Commit d9477486 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: SoundSlider: fix text color contrast. (closes #5040)

Uses half hsv's value between background and foreground
(instead of mid palette color which is only revealant for drawing over
buttons colors)
parent 4a3838cb
......@@ -619,7 +619,12 @@ void SoundSlider::paintEvent( QPaintEvent *e )
const QRectF boundsO( 0, 0, pixOutside.width(), pixOutside.height() );
painter.drawPixmap( boundsO, pixOutside, boundsO );
painter.setPen( palette().color( QPalette::Active, QPalette::Mid ) );
QColor background = palette().color( QPalette::Active, QPalette::Background );
QColor foreground = palette().color( QPalette::Active, QPalette::WindowText );
foreground.setHsv( foreground.hue(),
( background.saturation() + foreground.saturation() ) / 2,
( background.value() + foreground.value() ) / 2 );
painter.setPen( foreground );
QFont font; font.setPixelSize( 9 );
painter.setFont( font );
const QRect rect( 0, 0, 34, 15 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment