[welcome] Name widgets for styling
Widgets are easier to style if they have a name, and easier to spot in the widget tree as well. Give the requirements-checker parts meaningful names. SEE #1685
This commit is contained in:
parent
da2fff1256
commit
5d577371e7
@ -64,6 +64,7 @@ CheckerContainer::requirementsComplete( bool ok )
|
|||||||
m_waitingWidget = nullptr; // Don't delete in destructor
|
m_waitingWidget = nullptr; // Don't delete in destructor
|
||||||
|
|
||||||
m_checkerWidget = new ResultsListWidget( m_model, this );
|
m_checkerWidget = new ResultsListWidget( m_model, this );
|
||||||
|
m_checkerWidget->setObjectName( "requirementsChecker" );
|
||||||
layout()->addWidget( m_checkerWidget );
|
layout()->addWidget( m_checkerWidget );
|
||||||
|
|
||||||
m_verdict = ok;
|
m_verdict = ok;
|
||||||
|
@ -29,11 +29,14 @@ ResultWidget::ResultWidget( bool satisfied, bool required, QWidget* parent )
|
|||||||
setLayout( mainLayout );
|
setLayout( mainLayout );
|
||||||
|
|
||||||
m_iconLabel = new QLabel( this );
|
m_iconLabel = new QLabel( this );
|
||||||
mainLayout->addWidget( m_iconLabel );
|
|
||||||
m_iconLabel->setFixedSize( CalamaresUtils::defaultIconSize() );
|
m_iconLabel->setFixedSize( CalamaresUtils::defaultIconSize() );
|
||||||
|
m_iconLabel->setObjectName( "resultIcon" );
|
||||||
|
mainLayout->addWidget( m_iconLabel );
|
||||||
|
|
||||||
m_textLabel = new QLabel( this );
|
m_textLabel = new QLabel( this );
|
||||||
mainLayout->addWidget( m_textLabel );
|
|
||||||
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_textLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
|
m_textLabel->setObjectName( "resultText" );
|
||||||
|
mainLayout->addWidget( m_textLabel );
|
||||||
|
|
||||||
if ( satisfied )
|
if ( satisfied )
|
||||||
{
|
{
|
||||||
|
@ -52,9 +52,12 @@ createResultWidgets( QLayout* layout,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString checkName = model.data( index, Calamares::RequirementsModel::Name ).toString();
|
||||||
const bool is_satisfied = model.data( index, Calamares::RequirementsModel::Satisfied ).toBool();
|
const bool is_satisfied = model.data( index, Calamares::RequirementsModel::Satisfied ).toBool();
|
||||||
const bool is_mandatory = model.data( index, Calamares::RequirementsModel::Mandatory ).toBool();
|
const bool is_mandatory = model.data( index, Calamares::RequirementsModel::Mandatory ).toBool();
|
||||||
ResultWidget* ciw = new ResultWidget( is_satisfied, is_mandatory );
|
ResultWidget* ciw = new ResultWidget( is_satisfied, is_mandatory );
|
||||||
|
ciw->setObjectName( checkName );
|
||||||
|
|
||||||
layout->addWidget( ciw );
|
layout->addWidget( ciw );
|
||||||
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
ciw->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
|
|
||||||
@ -105,6 +108,7 @@ ResultsListDialog::ResultsListDialog( const Calamares::RequirementsModel& model,
|
|||||||
auto* entriesLayout = new QVBoxLayout;
|
auto* entriesLayout = new QVBoxLayout;
|
||||||
|
|
||||||
m_title = new QLabel( this );
|
m_title = new QLabel( this );
|
||||||
|
m_title->setObjectName( "resultDialogTitle" );
|
||||||
|
|
||||||
createResultWidgets(
|
createResultWidgets(
|
||||||
entriesLayout, m_resultWidgets, model, []( const Calamares::RequirementsModel& m, QModelIndex i ) {
|
entriesLayout, m_resultWidgets, model, []( const Calamares::RequirementsModel& m, QModelIndex i ) {
|
||||||
@ -112,6 +116,7 @@ ResultsListDialog::ResultsListDialog( const Calamares::RequirementsModel& model,
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this );
|
QDialogButtonBox* buttonBox = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this );
|
||||||
|
buttonBox->setObjectName( "resultDialogButtons" );
|
||||||
|
|
||||||
mainLayout->addWidget( m_title );
|
mainLayout->addWidget( m_title );
|
||||||
mainLayout->addLayout( entriesLayout );
|
mainLayout->addLayout( entriesLayout );
|
||||||
@ -168,6 +173,7 @@ ResultsListWidget::ResultsListWidget( const Calamares::RequirementsModel& model,
|
|||||||
m_explanation->setWordWrap( true );
|
m_explanation->setWordWrap( true );
|
||||||
m_explanation->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_explanation->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
m_explanation->setOpenExternalLinks( false );
|
m_explanation->setOpenExternalLinks( false );
|
||||||
|
m_explanation->setObjectName( "resultsExplanation" );
|
||||||
connect( m_explanation, &QLabel::linkActivated, this, &ResultsListWidget::linkClicked );
|
connect( m_explanation, &QLabel::linkActivated, this, &ResultsListWidget::linkClicked );
|
||||||
entriesLayout->addWidget( m_explanation );
|
entriesLayout->addWidget( m_explanation );
|
||||||
|
|
||||||
@ -208,9 +214,10 @@ ResultsListWidget::ResultsListWidget( const Calamares::RequirementsModel& model,
|
|||||||
}
|
}
|
||||||
|
|
||||||
imageLabel->setContentsMargins( 4, CalamaresUtils::defaultFontHeight() * 3 / 4, 4, 4 );
|
imageLabel->setContentsMargins( 4, CalamaresUtils::defaultFontHeight() * 3 / 4, 4, 4 );
|
||||||
mainLayout->addWidget( imageLabel );
|
|
||||||
imageLabel->setAlignment( Qt::AlignCenter );
|
imageLabel->setAlignment( Qt::AlignCenter );
|
||||||
imageLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
imageLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
|
||||||
|
imageLabel->setObjectName( "welcomeLogo" );
|
||||||
|
mainLayout->addWidget( imageLabel );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_explanation->setAlignment( Qt::AlignCenter );
|
m_explanation->setAlignment( Qt::AlignCenter );
|
||||||
|
Loading…
Reference in New Issue
Block a user