Commit 20b1d363 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: apply big and flat attributes to all QToolButton, even if they are sub-children of a QFrame.

This apply to teletext and DVD menus buttons.
Close #2516.
parent f9f17647
...@@ -426,21 +426,37 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options ) ...@@ -426,21 +426,37 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
/* Customize Buttons */ /* Customize Buttons */
if( b_flat || b_big ) if( b_flat || b_big )
{ {
QToolButton *tmpButton = qobject_cast<QToolButton *>(widget); QFrame *frame = qobject_cast<QFrame *>(widget);
if( tmpButton ) if( frame )
{ {
if( b_flat ) QList<QToolButton *> allTButtons = frame->findChildren<QToolButton *>();
tmpButton->setAutoRaise( b_flat ); for( int i = 0; i < allTButtons.size(); i++ )
if( b_big ) applyAttributes( allTButtons[i], b_flat, b_big );
{ }
tmpButton->setFixedSize( QSize( 32, 32 ) ); else
tmpButton->setIconSize( QSize( 26, 26 ) ); {
} QToolButton *tmpButton = qobject_cast<QToolButton *>(widget);
if( tmpButton )
applyAttributes( tmpButton, b_flat, b_big );
} }
} }
return widget; return widget;
} }
void AbstractController::applyAttributes( QToolButton *tmpButton, bool b_flat, bool b_big )
{
if( tmpButton )
{
if( b_flat )
tmpButton->setAutoRaise( b_flat );
if( b_big )
{
tmpButton->setFixedSize( QSize( 32, 32 ) );
tmpButton->setIconSize( QSize( 26, 26 ) );
}
}
}
QFrame *AbstractController::discFrame() QFrame *AbstractController::discFrame()
{ {
/** Disc and Menus handling */ /** Disc and Menus handling */
......
...@@ -51,6 +51,7 @@ class QBoxLayout; ...@@ -51,6 +51,7 @@ class QBoxLayout;
class QAbstractSlider; class QAbstractSlider;
class QAbstractButton; class QAbstractButton;
class InputSlider; class InputSlider;
class QToolButton;
class VolumeClickHandler; class VolumeClickHandler;
class WidgetListing; class WidgetListing;
...@@ -153,7 +154,7 @@ private: ...@@ -153,7 +154,7 @@ private:
static void setupButton( QAbstractButton * ); static void setupButton( QAbstractButton * );
QFrame *discFrame(); QFrame *discFrame();
QFrame *telexFrame(); QFrame *telexFrame();
void applyAttributes( QToolButton *, bool b_flat, bool b_big );
protected slots: protected slots:
virtual void setStatus( int ); virtual void setStatus( int );
......
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