avoid layout requirements from too many switch buttons

This commit is contained in:
Uwe Rathmann 2024-10-29 12:29:10 +01:00
parent 7402a145ec
commit 13be100e96

View File

@ -133,24 +133,18 @@ namespace
SwitchButtonBox( QQuickItem* parent = nullptr )
: ButtonBox( Qt::Horizontal, parent )
{
setDimension( 6 );
setDimension( 2 );
setSpacing( 20 );
setDefaultAlignment( Qt::AlignCenter );
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 button = new QskSwitchButton( orientation, this );
button->setIconMode( iconMode );
auto invertedButton = new QskSwitchButton( orientation, this );
invertedButton->setInverted( true );
invertedButton->setChecked( true );
invertedButton->setIconMode( iconMode );
}
auto invertedButton = new QskSwitchButton( orientation, this );
invertedButton->setInverted( true );
invertedButton->setChecked( true );
}
}
};