[calamares] Don't create sidebar if we don't want it

This commit is contained in:
Adriaan de Groot 2020-03-10 18:05:24 -05:00
parent 80f49bed1d
commit e9965d37e3
2 changed files with 9 additions and 2 deletions

View File

@ -172,8 +172,12 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
QBoxLayout* mainLayout = new QHBoxLayout; QBoxLayout* mainLayout = new QHBoxLayout;
setLayout( mainLayout ); setLayout( mainLayout );
QWidget* sideBox = getWidgetSidebar( QWidget* sideBox = nullptr;
qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) ); if ( branding->sidebarFlavor() == Calamares::Branding::SidebarFlavor::Widget )
{
sideBox = getWidgetSidebar(
qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
}
if ( sideBox ) if ( sideBox )
{ {
mainLayout->addWidget( sideBox ); mainLayout->addWidget( sideBox );

View File

@ -184,6 +184,9 @@ public:
} }
bool windowPlacementCentered() const { return m_windowPlacement == WindowPlacement::Center; } bool windowPlacementCentered() const { return m_windowPlacement == WindowPlacement::Center; }
///@brief Which sidebar flavor is configured
SidebarFlavor sidebarFlavor() const { return m_sidebarFlavor; }
/** /**
* Creates a map called "branding" in the global storage, and inserts an * Creates a map called "branding" in the global storage, and inserts an
* entry for each of the branding strings. This makes the branding * entry for each of the branding strings. This makes the branding