]> git.sesse.net Git - vlc/commitdiff
Qt4 - SoundSlider, add a caption of the volume on it after IRC idea.
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 11 Jan 2008 06:33:57 +0000 (06:33 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 11 Jan 2008 06:33:57 +0000 (06:33 +0000)
modules/gui/qt4/util/input_slider.cpp

index f05aced4ec0aad6853bc7c56b4a06b28989c6a0b..aca7b7e1a5fd5febd2f57264f6a30e0470dd28f5 100644 (file)
@@ -188,6 +188,13 @@ 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 ) );
+    QFont font; font.setPixelSize( 9 );
+    painter.setFont( font );
+    const QRect rect( 0, 0, 34, 15 );
+    painter.drawText( rect, Qt::AlignRight | Qt::AlignVCenter,
+                      QString::number( value() ) + '%' );
+
     painter.end();
 }