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 f05aced..aca7b7e 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();
 }