diff options
| author | Nathaniel Graham <[email protected]> | 2018-07-05 21:24:27 -0600 |
|---|---|---|
| committer | Nathaniel Graham <[email protected]> | 2018-07-05 21:24:49 -0600 |
| commit | 02c94b228a3ad9a5d39e850b9708f1c52c713c57 (patch) | |
| tree | 2844a36c99cb059208d85c5147dfa6a7be1496f8 /src/settings/startup/startupsettingspage.cpp | |
| parent | 85d7a8a2f60ffac614cc96120181cd8f1c4269b0 (diff) | |
Modernize Settings window
Summary: This patch modernizes the appearance of Dolphin's configuration window by following the KDE HIG as much as possible and following design cues from Plasma and System Settings.
Test Plan:
Tested all settings to make sure they still work; they do.
Startup page, before:
{F5825313}
Startup page, after:
{F5918574}
View page (Icons), before:
{F5825319}
View page (Icons) after:
{F5918575}
View page (Compact), before:
{F5825321}
View page (Compact) after:
{F5918700}
View page (Detailed), before:
{F5825323}
View page: (Detailed), after:
{F5918701}
Navigation page: no change
Trash page, before:
{F5858748}
Trash page, after:
{F5866656}
(Provided by {D12986})
General page (behavior), before:
{F5825316}
General page (behavior) after:
{F5918572}
General page (confirmations), before:
{F5866885}
General page (confirmations), after:
{F5918702}
General page (status bar): no change
Reviewers: #dolphin, #vdg, broulik, elvisangelaccio
Reviewed By: #dolphin, elvisangelaccio
Subscribers: fabianr, cfeck, medhefgo, zzag, rkflx, kfm-devel, elvisangelaccio, abetts
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D12571
Diffstat (limited to 'src/settings/startup/startupsettingspage.cpp')
| -rw-r--r-- | src/settings/startup/startupsettingspage.cpp | 71 |
1 files changed, 31 insertions, 40 deletions
diff --git a/src/settings/startup/startupsettingspage.cpp b/src/settings/startup/startupsettingspage.cpp index 4071ee04f..f8b7daa79 100644 --- a/src/settings/startup/startupsettingspage.cpp +++ b/src/settings/startup/startupsettingspage.cpp @@ -29,10 +29,10 @@ #include <QCheckBox> #include <QFileDialog> -#include <QGroupBox> -#include <QLabel> #include <QLineEdit> #include <QPushButton> +#include <QFormLayout> +#include <QHBoxLayout> #include <QVBoxLayout> StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : @@ -45,27 +45,18 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : m_filterBar(nullptr), m_showFullPathInTitlebar(nullptr) { - QVBoxLayout* topLayout = new QVBoxLayout(this); - QWidget* vBox = new QWidget(this); - QVBoxLayout *vBoxLayout = new QVBoxLayout(vBox); - vBoxLayout->setMargin(0); - vBoxLayout->setAlignment(Qt::AlignTop); + QFormLayout* topLayout = new QFormLayout(this); - // create 'Home URL' editor - QGroupBox* homeBox = new QGroupBox(i18nc("@title:group", "Home Folder"), vBox); - vBoxLayout->addWidget(homeBox); - QWidget* homeUrlBox = new QWidget(homeBox); - QHBoxLayout *homeUrlBoxLayout = new QHBoxLayout(homeUrlBox); + // create 'Home URL' editor + QHBoxLayout* homeUrlBoxLayout = new QHBoxLayout(); homeUrlBoxLayout->setMargin(0); - QLabel* homeUrlLabel = new QLabel(i18nc("@label:textbox", "Location:"), homeUrlBox); - homeUrlBoxLayout->addWidget(homeUrlLabel); - m_homeUrl = new QLineEdit(homeUrlBox); - homeUrlBoxLayout->addWidget(m_homeUrl); + m_homeUrl = new QLineEdit(); m_homeUrl->setClearButtonEnabled(true); + homeUrlBoxLayout->addWidget(m_homeUrl); - QPushButton* selectHomeUrlButton = new QPushButton(QIcon::fromTheme(QStringLiteral("folder-open")), QString(), homeUrlBox); + QPushButton* selectHomeUrlButton = new QPushButton(QIcon::fromTheme(QStringLiteral("folder-open")), QString()); homeUrlBoxLayout->addWidget(selectHomeUrlButton); #ifndef QT_NO_ACCESSIBILITY @@ -75,41 +66,41 @@ StartupSettingsPage::StartupSettingsPage(const QUrl& url, QWidget* parent) : connect(selectHomeUrlButton, &QPushButton::clicked, this, &StartupSettingsPage::selectHomeUrl); - QWidget* buttonBox = new QWidget(homeBox); - QHBoxLayout *buttonBoxLayout = new QHBoxLayout(buttonBox); + QHBoxLayout* buttonBoxLayout = new QHBoxLayout(); buttonBoxLayout->setMargin(0); - QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location"), buttonBox); + QPushButton* useCurrentButton = new QPushButton(i18nc("@action:button", "Use Current Location")); buttonBoxLayout->addWidget(useCurrentButton); connect(useCurrentButton, &QPushButton::clicked, this, &StartupSettingsPage::useCurrentLocation); - QPushButton* useDefaultButton = new QPushButton(i18nc("@action:button", "Use Default Location"), buttonBox); + QPushButton* useDefaultButton = new QPushButton(i18nc("@action:button", "Use Default Location")); buttonBoxLayout->addWidget(useDefaultButton); connect(useDefaultButton, &QPushButton::clicked, this, &StartupSettingsPage::useDefaultLocation); - QVBoxLayout* homeBoxLayout = new QVBoxLayout(homeBox); - homeBoxLayout->addWidget(homeUrlBox); - homeBoxLayout->addWidget(buttonBox); + QVBoxLayout* homeBoxLayout = new QVBoxLayout(); + homeBoxLayout->setMargin(0); + homeBoxLayout->addLayout(homeUrlBoxLayout); + homeBoxLayout->addLayout(buttonBoxLayout); - // create 'Split view', 'Show full path', 'Editable location' and 'Filter bar' checkboxes - m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Split view mode"), vBox); - vBoxLayout->addWidget(m_splitView); - m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar"), vBox); - vBoxLayout->addWidget(m_editableUrl); - m_showFullPath = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path inside location bar"), vBox); - vBoxLayout->addWidget(m_showFullPath); - m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar"), vBox); - vBoxLayout->addWidget(m_filterBar); - m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar"), vBox); - vBoxLayout->addWidget(m_showFullPathInTitlebar); + topLayout->addRow(i18nc("@label:textbox", "Start in:"), homeBoxLayout); - // Add a dummy widget with no restriction regarding - // a vertical resizing. This assures that the dialog layout - // is not stretched vertically. - new QWidget(vBox); - topLayout->addWidget(vBox); + topLayout->addItem(new QSpacerItem(0, Dolphin::VERTICAL_SPACER_HEIGHT, QSizePolicy::Fixed, QSizePolicy::Fixed)); + + + // create 'Split view', 'Show full path', 'Editable location' and 'Filter bar' checkboxes + m_splitView = new QCheckBox(i18nc("@option:check Startup Settings", "Split view mode")); + topLayout->addRow(i18nc("@label:checkbox", "Window options:"), m_splitView); + m_editableUrl = new QCheckBox(i18nc("@option:check Startup Settings", "Editable location bar")); + topLayout->addRow(QString(), m_editableUrl); + m_showFullPath = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path inside location bar")); + topLayout->addRow(QString(), m_showFullPath); + m_filterBar = new QCheckBox(i18nc("@option:check Startup Settings", "Show filter bar")); + topLayout->addRow(QString(), m_filterBar); + m_showFullPathInTitlebar = new QCheckBox(i18nc("@option:check Startup Settings", "Show full path in title bar")); + topLayout->addRow(QString(), m_showFullPathInTitlebar); + loadSettings(); |
