[license] Reduce margins hugely

- Move layouting code into the .ui file
 - Reduce margins hugely -- atop the title block, around the
   scroll area, etc -- so that more license is visible at once.
This commit is contained in:
Adriaan de Groot 2019-12-03 13:00:12 +01:00
parent 0b126b2c62
commit 9fa021e3c6
2 changed files with 25 additions and 19 deletions

View File

@ -98,21 +98,14 @@ LicensePage::LicensePage( QWidget* parent )
{ {
ui->setupUi( this ); ui->setupUi( this );
ui->verticalLayout->insertSpacing( 1, CalamaresUtils::defaultFontHeight() ); // ui->verticalLayout->insertSpacing( 1, CalamaresUtils::defaultFontHeight() );
CalamaresUtils::unmarginLayout( ui->verticalLayout );
ui->mainText->setAlignment( Qt::AlignCenter );
ui->mainText->setWordWrap( true ); ui->mainText->setWordWrap( true );
ui->mainText->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); ui->mainText->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
ui->additionalText->setWordWrap( true ); ui->additionalText->setWordWrap( true );
ui->verticalLayout->insertSpacing( 4, CalamaresUtils::defaultFontHeight() / 2 );
ui->verticalLayout->setContentsMargins( CalamaresUtils::defaultFontHeight(),
CalamaresUtils::defaultFontHeight() * 3,
CalamaresUtils::defaultFontHeight(),
CalamaresUtils::defaultFontHeight() );
ui->acceptFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain ); ui->acceptFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
ui->acceptFrame->setStyleSheet( "#acceptFrame { border: 1px solid red;" ui->acceptFrame->setStyleSheet( "#acceptFrame { border: 1px solid red;"
"background-color: #fff6f6;" "background-color: #fff6f6;"
@ -153,25 +146,22 @@ LicensePage::retranslate()
{ {
ui->acceptCheckBox->setText( tr( "I accept the terms and conditions above." ) ); ui->acceptCheckBox->setText( tr( "I accept the terms and conditions above." ) );
QString header = tr( "<h1>License Agreement</h1>" );
QString review = tr( "Please review the End User License Agreements (EULAs)." ); QString review = tr( "Please review the End User License Agreements (EULAs)." );
const auto br = QStringLiteral( "<br/>" ); const auto br = QStringLiteral( "<br/>" );
if ( !m_allLicensesOptional ) if ( !m_allLicensesOptional )
{ {
ui->mainText->setText( header ui->mainText->setText( tr( "This setup procedure will install proprietary "
+ tr( "This setup procedure will install proprietary " "software that is subject to licensing terms." )
"software that is subject to licensing terms." )
+ br + review ); + br + review );
ui->additionalText->setText( tr( "If you do not agree with the terms, the setup procedure cannot continue." ) ); ui->additionalText->setText( tr( "If you do not agree with the terms, the setup procedure cannot continue." ) );
} }
else else
{ {
ui->mainText->setText( header ui->mainText->setText( tr( "This setup procedure can install proprietary "
+ tr( "This setup procedure can install proprietary " "software that is subject to licensing terms "
"software that is subject to licensing terms " "in order to provide additional features and enhance the user "
"in order to provide additional features and enhance the user " "experience." )
"experience." )
+ br + review ); + br + review );
ui->additionalText->setText( tr( "If you do not agree with the terms, proprietary software will not " ui->additionalText->setText( tr( "If you do not agree with the terms, proprietary software will not "
"be installed, and open source alternatives will be used instead." ) ); "be installed, and open source alternatives will be used instead." ) );

View File

@ -16,6 +16,16 @@
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0,0"> <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,0,0,0">
<item>
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>&lt;h1&gt;License Agreement&lt;/h1&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="mainText"> <widget class="QLabel" name="mainText">
<property name="sizePolicy"> <property name="sizePolicy">
@ -30,6 +40,12 @@
<property name="text"> <property name="text">
<string notr="true">&lt;Calamares license text&gt;</string> <string notr="true">&lt;Calamares license text&gt;</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -71,7 +87,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>765</width> <width>765</width>
<height>86</height> <height>81</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="licenseEntriesLayout"/> <layout class="QVBoxLayout" name="licenseEntriesLayout"/>