[vlc-commits] Qt: SeekSlider: fix chapters marks contrast

Francois Cartegnie git at videolan.org
Wed Jul 13 15:17:54 CEST 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 13 15:05:49 2011 +0200| [f5ff9ebcc1cff62f0e29a64d240c6530c488cc00] | committer: Francois Cartegnie

Qt: SeekSlider: fix chapters marks contrast

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f5ff9ebcc1cff62f0e29a64d240c6530c488cc00
---

 modules/gui/qt4/util/input_slider.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index 53c9357..5654052 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -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 );



More information about the vlc-commits mailing list