[vlc-commits] commit: qt4: fix volume-slider tooltip to fit volume regarding fontsize ( Ilkka Ollakka )
git at videolan.org
git at videolan.org
Wed May 26 21:47:22 CEST 2010
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed May 26 22:46:09 2010 +0300| [770f3c56899da1bd79501cb5cc383beb727ea525] | committer: Ilkka Ollakka
qt4: fix volume-slider tooltip to fit volume regarding fontsize
Should Fix #3672
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=770f3c56899da1bd79501cb5cc383beb727ea525
---
modules/gui/qt4/util/input_slider.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/gui/qt4/util/input_slider.cpp b/modules/gui/qt4/util/input_slider.cpp
index c4f4685..1b94d66 100644
--- a/modules/gui/qt4/util/input_slider.cpp
+++ b/modules/gui/qt4/util/input_slider.cpp
@@ -324,7 +324,8 @@ void SoundSlider::paintEvent( QPaintEvent *e )
painter.setPen( palette().color( QPalette::Active, QPalette::Mid ) );
QFont font;
painter.setFont( font );
- const QRect rect( 0, 0, 34, 15 );
+ QFontMetrics fm = QFontMetrics( font );
+ const QRect rect = fm.boundingRect( QString::number( value() ) + '%' );
painter.drawText( rect, Qt::AlignRight | Qt::AlignVCenter,
QString::number( value() ) + '%' );
More information about the vlc-commits
mailing list