[libcalamaresui] Improve layout of "blank" view step

main
Adriaan de Groot 7 years ago
parent 9918dfb95f
commit bb5ac0326d

@ -32,6 +32,9 @@ BlankViewStep::BlankViewStep( const QString& title, const QString& description,
{ {
QBoxLayout* layout = new QVBoxLayout(); QBoxLayout* layout = new QVBoxLayout();
constexpr int const marginWidth = 10;
constexpr int const spacingHeight = 10;
auto* label = new QLabel( title ); auto* label = new QLabel( title );
label->setAlignment( Qt::AlignHCenter ); label->setAlignment( Qt::AlignHCenter );
label->setFont( CalamaresUtils::largeFont() ); label->setFont( CalamaresUtils::largeFont() );
@ -39,17 +42,19 @@ BlankViewStep::BlankViewStep( const QString& title, const QString& description,
label = new QLabel( description ); label = new QLabel( description );
label->setWordWrap( true ); label->setWordWrap( true );
layout->addSpacing( 10 ); label->setMargin( marginWidth );
layout->addSpacing( spacingHeight );
layout->addWidget( label ); layout->addWidget( label );
if ( !details.isEmpty() ) if ( !details.isEmpty() )
{ {
label = new QLabel( details ); label = new QLabel( details );
layout->addSpacing( 10 ); label->setMargin( marginWidth );
layout->addSpacing( spacingHeight );
layout->addWidget( label ); layout->addWidget( label );
} }
layout->addStretch( 10 ); layout->addStretch( 1 ); // Push the rest to the top
m_widget->setLayout( layout ); m_widget->setLayout( layout );
} }

@ -31,7 +31,8 @@ namespace Calamares
/** @brief A "blank" view step, used for error and status reporting /** @brief A "blank" view step, used for error and status reporting
* *
* * This view step never allows navigation (forward or back); it's a trap.
* It displays a title and explanation, and optional details.
*/ */
class BlankViewStep : public Calamares::ViewStep class BlankViewStep : public Calamares::ViewStep
{ {
@ -55,12 +56,6 @@ public:
bool isAtEnd() const override; bool isAtEnd() const override;
Calamares::JobList jobs() const override; Calamares::JobList jobs() const override;
#if 0
void onActivate() override;
void setConfigurationMap( const QVariantMap& configurationMap ) override;
#endif
private: private:
QWidget* m_widget; QWidget* m_widget;

Loading…
Cancel
Save