|
|
|
@ -47,15 +47,26 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|
|
|
|
string( Calamares::Branding::ProductName ) ) );
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
constexpr int min_w = 800;
|
|
|
|
|
constexpr int min_h = 520;
|
|
|
|
|
using CalamaresUtils::windowMinimumHeight;
|
|
|
|
|
using CalamaresUtils::windowMinimumWidth;
|
|
|
|
|
using CalamaresUtils::windowPreferredHeight;
|
|
|
|
|
using CalamaresUtils::windowPreferredWidth;
|
|
|
|
|
|
|
|
|
|
setMinimumSize( min_w, min_h );
|
|
|
|
|
QSize availableSize = qApp->desktop()->availableGeometry( this ).size();
|
|
|
|
|
int w = qBound( min_w, CalamaresUtils::defaultFontHeight() * 60, availableSize.width() );
|
|
|
|
|
int h = qBound( min_h, CalamaresUtils::defaultFontHeight() * 36, availableSize.height() );
|
|
|
|
|
|
|
|
|
|
cDebug() << "Proposed window size:" << w << h;
|
|
|
|
|
cDebug() << "Available size" << availableSize;
|
|
|
|
|
|
|
|
|
|
if ( (availableSize.width() < windowPreferredWidth) || (availableSize.height() < windowPreferredHeight) )
|
|
|
|
|
cDebug() << " Small screen detected.";
|
|
|
|
|
QSize minimumSize( qBound( windowMinimumWidth, availableSize.width(), windowPreferredWidth ),
|
|
|
|
|
qBound( windowMinimumHeight, availableSize.height(), windowPreferredHeight ) );
|
|
|
|
|
setMinimumSize( minimumSize );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int w = qBound( minimumSize.width(), CalamaresUtils::defaultFontHeight() * 60, availableSize.width() );
|
|
|
|
|
int h = qBound( minimumSize.height(), CalamaresUtils::defaultFontHeight() * 36, availableSize.height() );
|
|
|
|
|
|
|
|
|
|
cDebug() << " Proposed window size:" << w << h;
|
|
|
|
|
resize( w, h );
|
|
|
|
|
|
|
|
|
|
QBoxLayout* mainLayout = new QHBoxLayout;
|
|
|
|
@ -66,7 +77,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
|
|
|
|
|
|
|
|
|
|
QBoxLayout* sideLayout = new QVBoxLayout;
|
|
|
|
|
sideBox->setLayout( sideLayout );
|
|
|
|
|
sideBox->setFixedWidth( qMax( 190, CalamaresUtils::defaultFontHeight() * 12 ) );
|
|
|
|
|
sideBox->setFixedWidth( qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
|
|
|
|
|
sideBox->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
|
|
|
|
|
|
|
|
|
QHBoxLayout* logoLayout = new QHBoxLayout;
|
|
|
|
|