diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 05b7e919d..e4a081186 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -94,8 +94,7 @@ WelcomePage::WelcomePage( RequirementsChecker* requirementsChecker, QWidget* par mb.exec(); } ); - ui->verticalLayout->insertStretch( 3 ); - ui->verticalLayout->insertWidget( 4, m_requirementsChecker->widget() ); + ui->verticalLayout->insertWidget( 3, m_requirementsChecker->widget() ); } diff --git a/src/modules/welcome/WelcomePage.ui b/src/modules/welcome/WelcomePage.ui index 62b9dfbcb..a5197fef5 100644 --- a/src/modules/welcome/WelcomePage.ui +++ b/src/modules/welcome/WelcomePage.ui @@ -15,7 +15,7 @@ - + @@ -45,19 +45,6 @@ - - - - Qt::Vertical - - - - 20 - 20 - - - - diff --git a/src/modules/welcome/checker/CheckerWidget.cpp b/src/modules/welcome/checker/CheckerWidget.cpp index a97243d13..be341acc0 100644 --- a/src/modules/welcome/checker/CheckerWidget.cpp +++ b/src/modules/welcome/checker/CheckerWidget.cpp @@ -20,9 +20,10 @@ #include "CheckItemWidget.h" +#include "Branding.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Retranslator.h" -#include "Branding.h" +#include "widgets/FixedAspectRatioLabel.h" #include #include @@ -34,13 +35,13 @@ CheckerWidget::CheckerWidget( QWidget* parent ) : QWidget( parent ) { - setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); + setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); - QBoxLayout* mainLayout = new QVBoxLayout; - setLayout( mainLayout ); + m_mainLayout = new QVBoxLayout; + setLayout( m_mainLayout ); QHBoxLayout* spacerLayout = new QHBoxLayout; - mainLayout->addLayout( spacerLayout ); + m_mainLayout->addLayout( spacerLayout ); m_paddingSize = qBound( 32, CalamaresUtils::defaultFontHeight() * 4, 128 ); spacerLayout->addSpacing( m_paddingSize ); m_entriesLayout = new QVBoxLayout; @@ -128,11 +129,11 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries ) imagePath( Calamares::Branding::ProductWelcome ) ); if ( !theImage.isNull() ) { - QLabel* imageLabel = new QLabel; - imageLabel->setContentsMargins( 4, CalamaresUtils::defaultFontHeight(), 4, 4 ); - m_entriesLayout->addWidget( imageLabel ); + FixedAspectRatioLabel* imageLabel = new FixedAspectRatioLabel; + imageLabel->setContentsMargins( 4, CalamaresUtils::defaultFontHeight()*0.75, 4, 4 ); + m_mainLayout->addWidget( imageLabel ); imageLabel->setAlignment( Qt::AlignCenter ); - imageLabel->setScaledContents( false ); + imageLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); imageLabel->setPixmap( theImage ); } @@ -145,6 +146,10 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries ) textLabel->setAlignment( Qt::AlignCenter ); ) } + else + { + m_mainLayout->addStretch(); + } } diff --git a/src/modules/welcome/checker/CheckerWidget.h b/src/modules/welcome/checker/CheckerWidget.h index 604998b84..9e4accf23 100644 --- a/src/modules/welcome/checker/CheckerWidget.h +++ b/src/modules/welcome/checker/CheckerWidget.h @@ -35,6 +35,7 @@ public: private: void showDetailsDialog( const QList< PrepareEntry >& checkEntries ); + QBoxLayout* m_mainLayout; QBoxLayout* m_entriesLayout; int m_paddingSize; };