]> git.sesse.net Git - vlc/commitdiff
Qt: SeekSlider: fix chapters marks contrast
authorFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 13 Jul 2011 13:05:49 +0000 (15:05 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Wed, 13 Jul 2011 13:17:42 +0000 (15:17 +0200)
modules/gui/qt4/util/input_slider.cpp

index 53c93574d5eb51af427cf1b310daff7741b21a50..56540529d4be004aed81724108b842bc399984ed 100644 (file)
@@ -397,13 +397,18 @@ void SeekSlider::paintEvent( QPaintEvent *event )
         /* draw chapters tickpoints */
         if ( chapters && inputLength && size().width() )
         {
+            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 );
             if ( orientation() == Qt::Horizontal ) /* TODO: vertical */
             {
                 QList<SeekPoint> points = chapters->getPoints();
                 foreach( SeekPoint point, points )
                 {
                     int x = point.time / 1000000.0 / inputLength * size().width();
-                    painter.setPen( QColor( 80, 80, 80 ) );
+                    painter.setPen( foreground );
                     painter.setBrush( Qt::NoBrush );
                     painter.drawLine( x, 0, x, CHAPTERSSPOTSIZE );
                     painter.drawLine( x, height(), x, height() - CHAPTERSSPOTSIZE );