diff --git a/src/calamares/CalamaresWindow.cpp b/src/calamares/CalamaresWindow.cpp index aaeeced55..271e22cb9 100644 --- a/src/calamares/CalamaresWindow.cpp +++ b/src/calamares/CalamaresWindow.cpp @@ -47,19 +47,19 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) string( Calamares::Branding::ProductName ) ) ); ) - constexpr int min_w = 800; - constexpr int min_h = 520; - constexpr int preferred_min_w = 1050; - constexpr int preferred_min_h = 520; + using CalamaresUtils::windowMinimumHeight; + using CalamaresUtils::windowMinimumWidth; + using CalamaresUtils::windowPreferredHeight; + using CalamaresUtils::windowPreferredWidth; QSize availableSize = qApp->desktop()->availableGeometry( this ).size(); cDebug() << "Available size" << availableSize; - if ( (availableSize.width() < preferred_min_w) || (availableSize.height() < preferred_min_h) ) + if ( (availableSize.width() < windowPreferredWidth) || (availableSize.height() < windowPreferredHeight) ) cDebug() << " Small screen detected."; - QSize minimumSize( qBound( min_w, availableSize.width(), preferred_min_w ), - qBound( min_h, availableSize.height(), preferred_min_h ) ); + QSize minimumSize( qBound( windowMinimumWidth, availableSize.width(), windowPreferredWidth ), + qBound( windowMinimumHeight, availableSize.height(), windowPreferredHeight ) ); setMinimumSize( minimumSize ); @@ -77,7 +77,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent ) QBoxLayout* sideLayout = new QVBoxLayout; sideBox->setLayout( sideLayout ); - sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < preferred_min_w ? 100 : 190 ) ); + sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) ); sideBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); QHBoxLayout* logoLayout = new QHBoxLayout; diff --git a/src/libcalamaresui/utils/CalamaresUtilsGui.h b/src/libcalamaresui/utils/CalamaresUtilsGui.h index 224a3c2b2..24b23a946 100644 --- a/src/libcalamaresui/utils/CalamaresUtilsGui.h +++ b/src/libcalamaresui/utils/CalamaresUtilsGui.h @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014-2015, Teo Mrnjavac + * Copyright 2017, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,6 +71,13 @@ UIDLLEXPORT int defaultFontHeight(); UIDLLEXPORT QFont defaultFont(); UIDLLEXPORT QSize defaultIconSize(); +/** + * @brief Size constants for the main Calamares window. + */ +constexpr int windowMinimumWidth = 800; +constexpr int windowMinimumHeight = 520; +constexpr int windowPreferredWidth = 1024; +constexpr int windowPreferredHeight = 520; } #endif // CALAMARESUTILSGUI_H