[calamares] Support noexpand

- When in noexpand mode, just don't grow the window, and assume
   widgets elsewhere will get scrollbars automatically.
This commit is contained in:
Adriaan de Groot 2019-01-14 14:25:01 +01:00
parent 866797a6c9
commit ef94b1f689
3 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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() );
}

View File

@ -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 );