[license] Prevent single item from expanding

- the last item would expand vertically to fill the scroll area;
   add a spacer that pushes against it
main
Adriaan de Groot 5 years ago
parent 59ea0417fc
commit ac1c0d97d2

@ -137,6 +137,7 @@ LicensePage::setEntries( const QList< LicenseEntry >& entriesList )
m_entries.append( w ); m_entries.append( w );
m_allLicensesOptional &= !entry.isRequired(); m_allLicensesOptional &= !entry.isRequired();
} }
ui->licenseEntriesLayout->addSpacerItem( new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
ui->acceptCheckBox->setChecked( false ); ui->acceptCheckBox->setChecked( false );
checkAcceptance( false ); checkAcceptance( false );

@ -68,6 +68,7 @@ LicenseWidget::LicenseWidget( LicenseEntry entry, QWidget* parent )
QVBoxLayout* vLayout = new QVBoxLayout; QVBoxLayout* vLayout = new QVBoxLayout;
QWidget* topPart = new QWidget( this ); QWidget* topPart = new QWidget( this );
topPart->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
vLayout->addWidget( topPart ); vLayout->addWidget( topPart );
QHBoxLayout* wiLayout = new QHBoxLayout; QHBoxLayout* wiLayout = new QHBoxLayout;
@ -102,6 +103,7 @@ LicenseWidget::LicenseWidget( LicenseEntry entry, QWidget* parent )
m_licenceTextLabel->setText( tr( "URL: %1" ).arg( m_entry.m_url.toDisplayString() ) ); m_licenceTextLabel->setText( tr( "URL: %1" ).arg( m_entry.m_url.toDisplayString() ) );
connect( m_viewLicenseButton, &QAbstractButton::clicked, this, &LicenseWidget::viewClicked ); connect( m_viewLicenseButton, &QAbstractButton::clicked, this, &LicenseWidget::viewClicked );
} }
m_licenceTextLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
vLayout->addWidget( m_licenceTextLabel ); vLayout->addWidget( m_licenceTextLabel );
setLayout( vLayout ); setLayout( vLayout );

Loading…
Cancel
Save