diff options
| author | Méven Car <[email protected]> | 2026-03-05 10:40:06 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-03-05 10:45:47 +0100 |
| commit | 4c9500e42d143192ba73036f1d0f6a191ad80cf8 (patch) | |
| tree | d3bb5e09dae011af1338c17f86bfc1fedae9da31 /src/settings/interface/panelsettingspage.cpp | |
| parent | de4502909053fbea3295409540a97a5c74ca6611 (diff) | |
settings: make most settings page center aligned
Limit the width of text labels.
Diffstat (limited to 'src/settings/interface/panelsettingspage.cpp')
| -rw-r--r-- | src/settings/interface/panelsettingspage.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/settings/interface/panelsettingspage.cpp b/src/settings/interface/panelsettingspage.cpp index efa41e6c5..c564e97fc 100644 --- a/src/settings/interface/panelsettingspage.cpp +++ b/src/settings/interface/panelsettingspage.cpp @@ -26,7 +26,13 @@ PanelSettingsPage::PanelSettingsPage(QWidget *parent) , m_dateFormatShort(nullptr) { - QFormLayout *topLayout = new QFormLayout(this); + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setVerticalSizeConstraint(QLayout::SetFixedSize); + + QFormLayout *topLayout = new QFormLayout(); + layout->addLayout(topLayout); + topLayout->setFormAlignment(Qt::AlignHCenter); + topLayout->setSizeConstraint(QLayout::SizeConstraint::SetFixedSize); KFormat formatter; QString m_longDateTime = formatter.formatRelativeDateTime(QDateTime(QDate(2024, 02, 28), QTime(10, 0)), QLocale::LongFormat); @@ -47,13 +53,13 @@ PanelSettingsPage::PanelSettingsPage(QWidget *parent) topLayout->addRow(QString(), m_showHovered); topLayout->addRow(QString(), m_dateFormatLong); topLayout->addRow(QString(), m_dateFormatShort); - topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); QLabel *contextMenuHint = new QLabel(i18nc("@info", "Panel settings are also available through their context menu. Open it by pressing the right mouse button on a panel."), this); contextMenuHint->setWordWrap(true); - topLayout->addRow(contextMenuHint); + contextMenuHint->setMinimumWidth(topLayout->minimumSize().width()); + layout->addWidget(contextMenuHint, 0, Qt::AlignTop | Qt::AlignHCenter); loadSettings(); |
