From ef94b1f689904cab43e640b2b3643f1bb54aa693 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 14 Jan 2019 14:25:01 +0100 Subject: [PATCH] [calamares] Support noexpand - When in noexpand mode, just don't grow the window, and assume widgets elsewhere will get scrollbars automatically. --- src/branding/default/branding.desc | 2 +- src/calamares/CalamaresWindow.cpp | 3 ++- src/libcalamaresui/Branding.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/branding/default/branding.desc b/src/branding/default/branding.desc index b51eaec2e..5fefc422a 100644 --- a/src/branding/default/branding.desc +++ b/src/branding/default/branding.desc @@ -17,7 +17,7 @@ welcomeExpandingLogo: true # Size and expansion policy for Calamares. # - "normal" or unset, expand as needed, use *windowSize* # - "fullscreen", start as large as possible, ignore *windowSize* -# - "noexpand", never expand, use *windowSize* +# - "noexpand", don't expand automatically, use *windowSize* windowExpanding: normal # Size of Calamares window, expressed as w,h. Both w and h diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index bbc51750a..7e619a7be 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -147,7 +147,8 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) CalamaresUtils::unmarginLayout( mainLayout ); m_viewManager = Calamares::ViewManager::instance( this ); - connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge ); + if ( branding->windowExpands() ) + connect( m_viewManager, &Calamares::ViewManager::enlarge, this, &CalamaresWindow::enlarge ); mainLayout->addWidget( m_viewManager->centralWidget() ); } diff --git a/src/libcalamaresui/Branding.h b/src/libcalamaresui/Branding.h index cd1be1386..d97e0595a 100644 --- a/src/libcalamaresui/Branding.h +++ b/src/libcalamaresui/Branding.h @@ -112,6 +112,7 @@ public: bool welcomeStyleCalamares() const { return m_welcomeStyleCalamares; } bool welcomeExpandingLogo() const { return m_welcomeExpandingLogo; } bool windowMaximize() const { return m_windowExpansion == WindowExpansion::Fullscreen; } + bool windowExpands() const { return m_windowExpansion != WindowExpansion::Fixed; } QPair< WindowDimension, WindowDimension > windowSize() const { return QPair< WindowDimension, WindowDimension >( m_windowWidth, m_windowHeight );