Commit 3439c052 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: remove code duplication.

parent 11a75f69
...@@ -55,20 +55,18 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf, ...@@ -55,20 +55,18 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
/* We might need a subLayout too */ /* We might need a subLayout too */
QVBoxLayout *subLayout; QVBoxLayout *subLayout;
volMuteLabel->installEventFilter( this );
/* Normal View, click on icon mutes */ /* Normal View, click on icon mutes */
if( !b_special ) if( !b_special )
{ {
volMuteLabel->installEventFilter( this ); volumeMenu = NULL; subLayout = NULL;
volumeMenu = NULL;
subLayout = NULL;
} }
else else
{ {
/* Special view, click on button shows the slider */ /* Special view, click on button shows the slider */
b_shiny = false; b_shiny = false;
volMuteLabel->installEventFilter( this );
QFrame *volumeControlWidget = new QFrame; QFrame *volumeControlWidget = new QFrame;
subLayout = new QVBoxLayout( volumeControlWidget ); subLayout = new QVBoxLayout( volumeControlWidget );
subLayout->setLayoutMargins( 4, 4, 4, 4, 4 ); subLayout->setLayoutMargins( 4, 4, 4, 4, 4 );
...@@ -77,7 +75,6 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf, ...@@ -77,7 +75,6 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
QWidgetAction *widgetAction = new QWidgetAction( volumeControlWidget ); QWidgetAction *widgetAction = new QWidgetAction( volumeControlWidget );
widgetAction->setDefaultWidget( volumeControlWidget ); widgetAction->setDefaultWidget( volumeControlWidget );
volumeMenu->addAction( widgetAction ); volumeMenu->addAction( widgetAction );
} }
/* And add the label */ /* And add the label */
......
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