avoid layout requirements from too many switch buttons
This commit is contained in:
parent
7402a145ec
commit
13be100e96
@ -133,24 +133,18 @@ namespace
|
|||||||
SwitchButtonBox( QQuickItem* parent = nullptr )
|
SwitchButtonBox( QQuickItem* parent = nullptr )
|
||||||
: ButtonBox( Qt::Horizontal, parent )
|
: ButtonBox( Qt::Horizontal, parent )
|
||||||
{
|
{
|
||||||
setDimension( 6 );
|
setDimension( 2 );
|
||||||
setSpacing( 20 );
|
setSpacing( 20 );
|
||||||
setDefaultAlignment( Qt::AlignCenter );
|
setDefaultAlignment( Qt::AlignCenter );
|
||||||
|
|
||||||
for ( auto orientation : { Qt::Vertical, Qt::Horizontal } )
|
for ( auto orientation : { Qt::Vertical, Qt::Horizontal } )
|
||||||
{
|
{
|
||||||
using Q = QskSwitchButton;
|
auto button = new QskSwitchButton( orientation, this );
|
||||||
|
button->setIconMode( QskSwitchButton::ShowIconAlways );
|
||||||
|
|
||||||
for( auto iconMode : { Q::NoIcon, Q::ShowIconWhenSelected, Q::ShowIconAlways } )
|
auto invertedButton = new QskSwitchButton( orientation, this );
|
||||||
{
|
invertedButton->setInverted( true );
|
||||||
auto button = new QskSwitchButton( orientation, this );
|
invertedButton->setChecked( true );
|
||||||
button->setIconMode( iconMode );
|
|
||||||
|
|
||||||
auto invertedButton = new QskSwitchButton( orientation, this );
|
|
||||||
invertedButton->setInverted( true );
|
|
||||||
invertedButton->setChecked( true );
|
|
||||||
invertedButton->setIconMode( iconMode );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user