From d4c44c21a3d83fac674b8372e101370be7f5d2ff Mon Sep 17 00:00:00 2001 From: Rello Date: Tue, 13 Jan 2026 16:41:35 +0700 Subject: [PATCH 1/3] feat: refine settings sidebar layout --- src/gui/owncloudgui.h | 2 +- src/gui/settingsdialog.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/owncloudgui.h b/src/gui/owncloudgui.h index 40006a905c190..a57dcab2e2bbc 100644 --- a/src/gui/owncloudgui.h +++ b/src/gui/owncloudgui.h @@ -49,7 +49,7 @@ class ownCloudGui : public QObject bool checkAccountExists(bool openSettings); static void raiseDialog(QWidget *raiseWidget); - static QSize settingsDialogSize() { return {800, 500}; } + static QSize settingsDialogSize() { return {720, 500}; } void setupOverlayIcons(); #ifdef WITH_LIBCLOUDPROVIDERS void setupCloudProviders(); diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 5bcb74a43fd8b..b4d0a35cb0d32 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -38,7 +38,7 @@ namespace { const QString TOOLBAR_CSS() { return QStringLiteral("QToolBar { background: %1; margin: 0; padding: 0; border: none; border-right: 1px solid %2; spacing: 0; } " - "QToolBar QToolButton { background: %1; border: none; border-bottom: 1px solid %2; margin: 0; padding: 5px; } " + "QToolBar QToolButton { background: %1; border: none; margin: 0; padding: 8px 10px; font-size: 13px; } " "QToolBar QToolBarExtension { padding:0; } " "QToolBar QToolButton:checked { background: %3; color: %4; }"); } @@ -84,6 +84,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); _toolBar->setOrientation(Qt::Vertical); _toolBar->setMovable(false); + _toolBar->setMinimumWidth(220); _ui->mainLayout->insertWidget(0, _toolBar); _ui->mainLayout->setStretch(0, 0); _ui->mainLayout->setStretch(1, 1); @@ -112,6 +113,9 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) QAction *generalAction = createColorAwareAction(QLatin1String(":/client/theme/settings.svg"), tr("General")); _actionGroup->addAction(generalAction); _toolBar->addAction(generalAction); + auto *accountSpacer = new QWidget(this); + accountSpacer->setFixedHeight(8); + _toolBar->addWidget(accountSpacer); _toolBar->addSeparator(); auto *generalSettings = new GeneralSettings; _ui->stack->addWidget(generalSettings); From 57b880c138f608fe64fed490e853034d8d62da26 Mon Sep 17 00:00:00 2001 From: Rello Date: Tue, 13 Jan 2026 19:47:53 +0700 Subject: [PATCH 2/3] feat: soften settings dialog visuals --- src/gui/settingsdialog.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index b4d0a35cb0d32..d20317978e8a4 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -37,8 +37,8 @@ namespace { const QString TOOLBAR_CSS() { - return QStringLiteral("QToolBar { background: %1; margin: 0; padding: 0; border: none; border-right: 1px solid %2; spacing: 0; } " - "QToolBar QToolButton { background: %1; border: none; margin: 0; padding: 8px 10px; font-size: 13px; } " + return QStringLiteral("QToolBar { background: %1; margin: 0; padding: 0; border: none; spacing: 0; } " + "QToolBar QToolButton { background: %1; border: none; margin: 0; padding: 8px 12px; font-size: 14px; } " "QToolBar QToolBarExtension { padding:0; } " "QToolBar QToolButton:checked { background: %3; color: %4; }"); } @@ -79,15 +79,31 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) ConfigFile cfg; _ui->setupUi(this); + _ui->mainLayout->setContentsMargins(12, 12, 12, 12); + _ui->mainLayout->setSpacing(12); _toolBar = new QToolBar; _toolBar->setIconSize(QSize(32, 32)); _toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); _toolBar->setOrientation(Qt::Vertical); _toolBar->setMovable(false); _toolBar->setMinimumWidth(220); - _ui->mainLayout->insertWidget(0, _toolBar); + auto *sidebarContainer = new QWidget(this); + sidebarContainer->setObjectName(QLatin1String("settings_sidebar")); + auto *sidebarLayout = new QVBoxLayout(sidebarContainer); + sidebarLayout->setContentsMargins(12, 12, 12, 12); + sidebarLayout->setSpacing(0); + sidebarLayout->addWidget(_toolBar); + _ui->mainLayout->insertWidget(0, sidebarContainer); _ui->mainLayout->setStretch(0, 0); _ui->mainLayout->setStretch(1, 1); + _ui->mainLayout->removeWidget(_ui->stack); + auto *contentContainer = new QWidget(this); + contentContainer->setObjectName(QLatin1String("settings_content")); + auto *contentLayout = new QVBoxLayout(contentContainer); + contentLayout->setContentsMargins(16, 16, 16, 16); + contentLayout->setSpacing(0); + contentLayout->addWidget(_ui->stack); + _ui->mainLayout->insertWidget(1, contentContainer); // People perceive this as a Window, so also make Ctrl+W work auto *closeWindowAction = new QAction(this); @@ -119,6 +135,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _toolBar->addSeparator(); auto *generalSettings = new GeneralSettings; _ui->stack->addWidget(generalSettings); + _ui->stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching) connect(this, &SettingsDialog::styleChanged, generalSettings, &GeneralSettings::slotStyleChanged); @@ -154,6 +171,9 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint & Qt::Window); cfg.restoreGeometry(this); + setStyleSheet(QStringLiteral( + "#Settings { background: #f2f2f2; }" + "#settings_sidebar, #settings_content { background: #e7e7e7; border-radius: 12px; }")); } SettingsDialog::~SettingsDialog() From 52e6180bf6354622ba349d0df6774704346b16e3 Mon Sep 17 00:00:00 2001 From: Rello Date: Tue, 13 Jan 2026 19:48:09 +0700 Subject: [PATCH 3/3] feat: add settings panel styling --- src/gui/accountsettings.ui | 557 +++++++++++++++++++++---------------- src/gui/generalsettings.ui | 2 +- src/gui/settingsdialog.cpp | 39 +-- 3 files changed, 331 insertions(+), 267 deletions(-) diff --git a/src/gui/accountsettings.ui b/src/gui/accountsettings.ui index 2db413221b169..505e7377f7fb2 100644 --- a/src/gui/accountsettings.ui +++ b/src/gui/accountsettings.ui @@ -14,241 +14,138 @@ Form - - - - - - - 0 - 0 - - - - - - - Storage space: … - - - Qt::PlainText - - - false - - - - - - - false - - - - 0 - 0 - - - - - 16777215 - 7 - - - - 100 - - - -1 - - - false - - - - - - - - - - - - - - - 0 - 0 - - - - Unchecked folders will be <b>removed</b> from your local file system and will not be synchronized to this computer anymore - - - Qt::RichText - - - true - - - true - - - - - + + + + QFrame::NoFrame + + + + 12 + + + 12 + + + 12 + + + 12 + - - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + + - + 0 0 - Cancel + - - + + - + 0 0 - Apply + Connected with <server> as <user> + + + Qt::RichText + + + true + + + true - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - Connected with <server> as <user> - - - Qt::RichText - - - true - - - true - - + + - - - - - + + + QFrame::NoFrame + + - 0 + 12 - 0 + 12 - 0 + 12 - 0 + 12 - - - color: red - - - - - - true - - - - - + - - - Qt::Horizontal + + + + 0 + 0 + - - - 40 - 20 - + + - - - - - Synchronize all + Storage space: … - - - - - - Synchronize none + + Qt::PlainText + + + false - - - Apply manual changes + + + false + + + + 0 + 0 + + + + + 16777215 + 7 + + + + 100 + + + -1 + + + false @@ -257,68 +154,234 @@ - - - - QTabWidget::Rounded - - - 0 + + + + QFrame::NoFrame - - - Standard file sync - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - Qt::CustomContextMenu - - - false + + + 12 + + + 12 + + + 12 + + + 12 + + + + + QTabWidget::Rounded + + + 0 + + + + Standard file sync + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Qt::CustomContextMenu + + + false + + + QFrame::Shape::NoFrame + + + QAbstractItemView::NoEditTriggers + + + true + + + + + + + + Virtual file sync + + + + + Connection settings + + + + + + + + + + + + + + 0 + 0 + + + + Unchecked folders will be <b>removed</b> from your local file system and will not be synchronized to this computer anymore + + + Qt::RichText + + + true + + + true + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Cancel + + + + + + + + 0 + 0 + + + + Apply + + + + + + + + + + + + + + 0 - - QFrame::Shape::NoFrame + + 0 - - QAbstractItemView::NoEditTriggers + + 0 - - true + + 0 - - - - - - - Virtual file sync - - - - - Connection settings - - + + + + color: red + + + + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Synchronize all + + + + + + + Synchronize none + + + + + + + Apply manual changes + + + + + + + + + diff --git a/src/gui/generalsettings.ui b/src/gui/generalsettings.ui index b26f433ed2653..7cb2d893cd7eb 100644 --- a/src/gui/generalsettings.ui +++ b/src/gui/generalsettings.ui @@ -69,7 +69,7 @@ - + Advanced diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index d20317978e8a4..e08b78d174c44 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -80,30 +80,24 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _ui->setupUi(this); _ui->mainLayout->setContentsMargins(12, 12, 12, 12); - _ui->mainLayout->setSpacing(12); + _ui->mainLayout->setSpacing(0); _toolBar = new QToolBar; _toolBar->setIconSize(QSize(32, 32)); _toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); _toolBar->setOrientation(Qt::Vertical); _toolBar->setMovable(false); _toolBar->setMinimumWidth(220); - auto *sidebarContainer = new QWidget(this); - sidebarContainer->setObjectName(QLatin1String("settings_sidebar")); - auto *sidebarLayout = new QVBoxLayout(sidebarContainer); - sidebarLayout->setContentsMargins(12, 12, 12, 12); - sidebarLayout->setSpacing(0); - sidebarLayout->addWidget(_toolBar); - _ui->mainLayout->insertWidget(0, sidebarContainer); - _ui->mainLayout->setStretch(0, 0); - _ui->mainLayout->setStretch(1, 1); + auto *shellContainer = new QWidget(this); + shellContainer->setObjectName(QLatin1String("settings_shell")); + auto *shellLayout = new QHBoxLayout(shellContainer); + shellLayout->setContentsMargins(12, 12, 12, 12); + shellLayout->setSpacing(12); + shellLayout->addWidget(_toolBar); + shellLayout->addWidget(_ui->stack); + shellLayout->setStretch(0, 0); + shellLayout->setStretch(1, 1); _ui->mainLayout->removeWidget(_ui->stack); - auto *contentContainer = new QWidget(this); - contentContainer->setObjectName(QLatin1String("settings_content")); - auto *contentLayout = new QVBoxLayout(contentContainer); - contentLayout->setContentsMargins(16, 16, 16, 16); - contentLayout->setSpacing(0); - contentLayout->addWidget(_ui->stack); - _ui->mainLayout->insertWidget(1, contentContainer); + _ui->mainLayout->insertWidget(0, shellContainer); // People perceive this as a Window, so also make Ctrl+W work auto *closeWindowAction = new QAction(this); @@ -132,7 +126,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) auto *accountSpacer = new QWidget(this); accountSpacer->setFixedHeight(8); _toolBar->addWidget(accountSpacer); - _toolBar->addSeparator(); auto *generalSettings = new GeneralSettings; _ui->stack->addWidget(generalSettings); _ui->stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); @@ -173,7 +166,15 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) cfg.restoreGeometry(this); setStyleSheet(QStringLiteral( "#Settings { background: #f2f2f2; }" - "#settings_sidebar, #settings_content { background: #e7e7e7; border-radius: 12px; }")); + "#settings_shell { background: #e7e7e7; border-radius: 12px; }" + "#generalGroupBox, #advancedGroupBox, #aboutAndUpdatesGroupBox," + "#accountStatusPanel, #accountStoragePanel, #accountTabsPanel {" + " background: #f2f2f2; border-radius: 10px; border: none; }" + "#generalGroupBox, #advancedGroupBox, #aboutAndUpdatesGroupBox {" + " margin-top: 8px; padding: 12px; }" + "#generalGroupBox::title, #advancedGroupBox::title, #aboutAndUpdatesGroupBox::title {" + " subcontrol-origin: margin; left: 12px; top: 6px; padding: 0 4px; }" + "#accountStatusPanel, #accountStoragePanel, #accountTabsPanel { padding: 12px; }")); } SettingsDialog::~SettingsDialog()