X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fcontroller_widget.cpp;h=d6916bae3860d69f2c9df5dd7bbcc315ca828e45;hb=60e75ffe8f3643379916d86625203426854df5e5;hp=fbb19becad3f92a97783ab8a360064a1259475f6;hpb=4d218ceb5fc9664d95665874559a45fe9cc0250e;p=vlc diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp index fbb19becad..d6916bae38 100644 --- a/modules/gui/qt4/components/controller_widget.cpp +++ b/modules/gui/qt4/components/controller_widget.cpp @@ -111,8 +111,8 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf, layout->addWidget( volumeSlider, 0, Qt::AlignBottom ); /* Set the volume from the config */ - volumeSlider->setValue( ( config_GetInt( p_intf, "volume" ) ) * - VOLUME_MAX / (AOUT_VOLUME_MAX/2) ); + volumeSlider->setValue( qRound( ( (qreal)config_GetInt( p_intf, "volume" ) ) * + VOLUME_MAX / (AOUT_VOLUME_MAX/2) ) ); /* Force the update at build time in order to have a muted icon if needed */ updateVolume( volumeSlider->value() ); @@ -140,7 +140,7 @@ void SoundWidget::updateVolume( int i_sliderVolume ) if( i_sliderVolume == 0 ) { volMuteLabel->setPixmap( QPixmap(":/toolbar/volume-muted" ) ); - volMuteLabel->setToolTip( qtr( "Unmute" ) ); + volMuteLabel->setToolTip(qfu(vlc_pgettext("Tooltip|Unmute", "Unmute"))); return; } @@ -149,7 +149,7 @@ void SoundWidget::updateVolume( int i_sliderVolume ) else if( i_sliderVolume > (VOLUME_MAX * 2 / 3 ) ) volMuteLabel->setPixmap( QPixmap( ":/toolbar/volume-high" ) ); else volMuteLabel->setPixmap( QPixmap( ":/toolbar/volume-medium" ) ); - volMuteLabel->setToolTip( qtr( "Mute" ) ); + volMuteLabel->setToolTip( qfu(vlc_pgettext("Tooltip|Mute", "Mute")) ); } void SoundWidget::updateVolume() @@ -173,6 +173,7 @@ void SoundWidget::updateVolume() void SoundWidget::showVolumeMenu( QPoint pos ) { + volumeMenu->setFixedHeight( volumeMenu->sizeHint().height() ); volumeMenu->exec( QCursor::pos() - pos - QPoint( 0, volumeMenu->height()/2 ) + QPoint( width(), height() /2) ); }