Commit 8a99e94b authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Volume: if volume > 50% of the sliderBar, then show the highVolume Label.

parent b399b131
......@@ -462,18 +462,18 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i, bool b_advControls ) :
prefs() );
setupSmallButton( prefsButton );
controlLayout->addWidget( prefsButton, 3, 13 );
controlLayout->setColumnStretch( 14, 5 );
/* Volume */
VolumeClickHandler *h = new VolumeClickHandler( p_intf, this );
QLabel *volMuteLabel = new QLabel;
volMuteLabel = new QLabel;
volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
volMuteLabel->setToolTip( qtr( "Mute" ) );
volMuteLabel->installEventFilter( h );
/** TODO:
/** TODO:
* Change this slider to use a nice Amarok-like one
* Add a Context menu to change to the most useful %
* **/
......@@ -553,13 +553,16 @@ void ControlsWidget::setNavigation( int navigation )
}
static bool b_my_volume;
void ControlsWidget::updateVolume( int sliderVolume )
void ControlsWidget::updateVolume( int i_sliderVolume )
{
if( !b_my_volume )
{
int i_res = sliderVolume * AOUT_VOLUME_MAX /
int i_res = i_sliderVolume * AOUT_VOLUME_MAX /
( 2*volumeSlider->maximum() );
aout_VolumeSet( p_intf, i_res );
if( i_sliderVolume < volumeSlider->maximum()/2 )
volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-low.png" ) );
else volMuteLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) );
}
}
......
......@@ -155,6 +155,7 @@ private:
QPushButton *playButton, *fullscreenButton;
QPushButton *slowerButton, *fasterButton;
AdvControlsWidget *advControls;
QLabel *volMuteLabel;
bool b_advancedVisible;
private slots:
......
......@@ -650,7 +650,7 @@ void MainInterface::toggleAdvanced()
int MainInterface::getControlsVisibilityStatus()
{
return( (controls->isVisible() ? 0x2 : 0x0 )
return( (controls->isVisible() ? 0x2 : 0x0 )
+ controls->b_advancedVisible );
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment