From 3d363dd4736a1d84d15ae89ca83bdb0c884d3929 Mon Sep 17 00:00:00 2001 From: memurats Date: Fri, 24 Oct 2025 11:52:03 +0200 Subject: [PATCH 01/14] main settings dialog changes --- src/gui/CMakeLists.txt | 7 ++ src/gui/nmcgui/nmcsettingsdialog.cpp | 96 ++++++++++++++++++++++++++++ src/gui/nmcgui/nmcsettingsdialog.h | 70 ++++++++++++++++++++ src/gui/owncloudgui.cpp | 3 +- src/gui/settingsdialog.cpp | 13 +++- src/gui/settingsdialog.h | 10 ++- theme/account.svg | 12 ++-- theme/network.svg | 8 ++- theme/settings.svg | 12 ++-- 9 files changed, 213 insertions(+), 18 deletions(-) create mode 100644 src/gui/nmcgui/nmcsettingsdialog.cpp create mode 100644 src/gui/nmcgui/nmcsettingsdialog.h diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 7f45acfeba5ed..f77785092d1d1 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,6 +6,9 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui find_package(KF6Archive REQUIRED) find_package(KF6GuiAddons) +#NMC customization: needed to find the ui file in a different location than the header file +set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") + if(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DQT_QML_DEBUG) endif() @@ -259,6 +262,10 @@ set(client_SRCS integration/fileactionsmodel.cpp ) +file(GLOB NMC_FILES "nmcgui/*") +set(NMC_SRCS ${NMC_FILES}) +list(APPEND client_SRCS ${NMC_SRCS}) + if (NOT DISABLE_ACCOUNT_MIGRATION) list(APPEND client_SRCS legacyaccountselectiondialog.h diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp new file mode 100644 index 0000000000000..2ed349e7f1018 --- /dev/null +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -0,0 +1,96 @@ +/* + * Copyright (C) by Eugen Fischer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#include "nmcsettingsdialog.h" +#include +#include +#include +#include "settingsdialog.h" + +namespace OCC { + +NMCSettingsDialog::NMCSettingsDialog(ownCloudGui *gui, QWidget *parent) + : SettingsDialog(gui, parent) +{ + setLayout(); + + // The window has no background widget, use palette + // QPalette palette; + // palette.setColor(QPalette::Window, QColor("#F3f3f3")); + // setPalette(palette); + + setFixedSize(760,760); + + getToolBar()->setFixedHeight(92); // 76px button height + 8 + 8 margin top and bottom + getToolBar()->setContentsMargins(8, 0, 8, 0); // Left margin not accepted, Qt bug? +} + +void NMCSettingsDialog::slotAccountAvatarChanged() +{ + //Intercept the base class slot, so the round avatar is not set. (dont pass to base class) + //Fix Account button size, for ech new created account + fixAccountButton(); +} + +void OCC::NMCSettingsDialog::setLayout() const +{ + //Fix network and general settings button size + const auto actions = getToolBar()->actions(); + for(auto *action : actions) + { + if((action->text() == QCoreApplication::translate("OCC::SettingsDialog","General") || action->text() == QCoreApplication::tr("General")) || + (action->text() == QCoreApplication::translate("OCC::SettingsDialog","Network") || action->text() == QCoreApplication::tr("Network")) || + (action->text() == QCoreApplication::translate("OCC::SettingsDialog","Account") || action->text() == QCoreApplication::tr("Account"))) + { + auto *widget = getToolBar()->widgetForAction(action); + if(widget) + { + widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + widget->setFixedSize(76, 76); + } + } + } + + //Fix initial account button size and stylesheet + fixAccountButton(); +} + +void NMCSettingsDialog::fixAccountButton() const +{ + auto toolbar = getToolBar(); + + // Sicher prüfen, ob ein Spacer schon existiert + auto *firstAction = toolbar->actions().at(0); + auto *firstWidget = toolbar->widgetForAction(firstAction); + if (!firstWidget || !firstWidget->objectName().startsWith("spacer_left")) { + auto *spacer = new QWidget(toolbar); + spacer->setFixedWidth(16); + spacer->setObjectName("spacer_left"); + spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + toolbar->insertWidget(firstAction, spacer); + } + + // Account-Button anpassen + if (toolbar->actions().size() > 1) { + auto action = toolbar->actions().at(1); // Index 1, da davor Spacer + auto *widget = toolbar->widgetForAction(action); + if(widget) + { + widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + widget->setFixedSize(152, 76); + } + } +} + +} // namespace OCC diff --git a/src/gui/nmcgui/nmcsettingsdialog.h b/src/gui/nmcgui/nmcsettingsdialog.h new file mode 100644 index 0000000000000..2e917e809d8f6 --- /dev/null +++ b/src/gui/nmcgui/nmcsettingsdialog.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) by Eugen Fischer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#ifndef MIRALL_SETTINGSDIALOGMAGENTA_H +#define MIRALL_SETTINGSDIALOGMAGENTA_H + +#include + +namespace OCC { + +/** + * @brief The NMCSettingsDialog class + * + * This class represents the settings dialog specific to the Magenta theme. + * It inherits from SettingsDialog and provides additional functionalities + * or customizations related to the Magenta theme. + * + * @ingroup gui + */ +class NMCSettingsDialog : public SettingsDialog +{ + Q_OBJECT + +public: + /** + * @brief Constructor for NMCSettingsDialog + * + * @param gui Pointer to the ownCloudGui instance. + * @param parent Pointer to the parent QWidget (default is nullptr). + */ + explicit NMCSettingsDialog(ownCloudGui *gui, QWidget *parent = nullptr); + + /** + * @brief Destructor for NMCSettingsDialog + */ + ~NMCSettingsDialog() = default; + +public slots: + /** + * @brief Slot for handling changes in the account avatar + */ + void slotAccountAvatarChanged(); + + // NMCGuiInterface interface +protected: + /** + * @brief Sets the layout for the NMCSettingsDialog + */ + void setLayout() const; + +private: + /** + * @brief Fixes the appearance of the account button + */ + void fixAccountButton() const; +}; + +} // namespace OCC +#endif // MIRALL_SETTINGSDIALOGMAGENTA_H diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index a4510d013e401..411ee56140009 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -21,6 +21,7 @@ #include "owncloudsetupwizard.h" #include "progressdispatcher.h" #include "settingsdialog.h" +#include "nmcgui/nmcsettingsdialog.h" #include "theme.h" #include "wheelhandler.h" #include "syncconflictsmodel.h" @@ -621,7 +622,7 @@ void ownCloudGui::slotShowGuiMessage(const QString &title, const QString &messag void ownCloudGui::slotShowSettings() { if (_settingsDialog.isNull()) { - _settingsDialog = new SettingsDialog(this); + _settingsDialog = new NMCSettingsDialog(this); _settingsDialog->setAttribute(Qt::WA_DeleteOnClose, true); #ifdef Q_OS_MACOS diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index d6e8336f83281..6a361a981a521 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -5,6 +5,8 @@ */ #include "settingsdialog.h" +#include "ui_settingsdialog.h" +#include "QtWidgets/qmainwindow.h" #include "folderman.h" #include "theme.h" @@ -119,7 +121,7 @@ QString shortDisplayNameForSettings(OCC::Account *account, int width) host = fm.elidedText(host, Qt::ElideMiddle, width); user = fm.elidedText(user, Qt::ElideRight, width); } - return QStringLiteral("%1\n%2").arg(user, host); + return QStringLiteral("%1").arg(user); } } @@ -191,6 +193,12 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _stack->addWidget(generalSettings); _stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); + // Adds space between general and network actions + auto *spacer2 = new QWidget(); + spacer2->setFixedWidth(8); + spacer2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + _toolBar->addWidget(spacer2); + // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching) connect(this, &SettingsDialog::styleChanged, generalSettings, &GeneralSettings::slotStyleChanged); @@ -339,7 +347,7 @@ void SettingsDialog::accountAdded(AccountState *s) updateAccountAvatar(s->account().data()); if (!brandingSingleAccount) { - accountAction->setToolTip(s->account()->displayName()); + accountAction->setToolTip(shortDisplayNameForSettings(s->account().data(), static_cast(height * buttonSizeRatio))); accountAction->setIconText(shortDisplayNameForSettings(s->account().data(), static_cast(height * buttonSizeRatio))); } @@ -410,6 +418,7 @@ void SettingsDialog::slotAccountDisplayNameChanged() QString displayName = account->displayName(); action->setText(displayName); auto height = _toolBar->sizeHint().height(); + action->setToolTip(shortDisplayNameForSettings(account, static_cast(height * buttonSizeRatio))); action->setIconText(shortDisplayNameForSettings(account, static_cast(height * buttonSizeRatio))); } } diff --git a/src/gui/settingsdialog.h b/src/gui/settingsdialog.h index e79a7e4840990..89fda7984d296 100644 --- a/src/gui/settingsdialog.h +++ b/src/gui/settingsdialog.h @@ -43,13 +43,18 @@ class SettingsDialog : public QDialog QWidget* currentPage(); + QToolBar *getToolBar() const + { + return _toolBar; + } + public slots: void showFirstPage(); void showAccount(OCC::AccountState *account); void setInitialAccount(OCC::AccountState *account); void showIssuesList(OCC::AccountState *account); void slotSwitchPage(QAction *action); - void slotAccountAvatarChanged(); + virtual void slotAccountAvatarChanged(); void slotAccountDisplayNameChanged(); signals: @@ -67,11 +72,12 @@ private slots: void accountAdded(OCC::AccountState *); void accountRemoved(OCC::AccountState *); -private: +protected: void customizeStyle(); void requestStyleUpdate(); void updateAccountAvatar(const Account *account); +private: QAction *createColorAwareAction(const QString &iconName, const QString &fileName); QAction *createActionWithIcon(const QIcon &icon, const QString &text, const QString &iconPath = QString()); diff --git a/theme/account.svg b/theme/account.svg index 8168da5fa5ee5..bde174912436d 100644 --- a/theme/account.svg +++ b/theme/account.svg @@ -1,7 +1,7 @@ - - - - - + + + icon/user_file/user/default@svg + + - + \ No newline at end of file diff --git a/theme/network.svg b/theme/network.svg index ca6455df5b41e..2f9e7bdf3cc61 100644 --- a/theme/network.svg +++ b/theme/network.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + /svg/icon/home/wifi/default + + + + \ No newline at end of file diff --git a/theme/settings.svg b/theme/settings.svg index a9c68e4067248..434caf275d458 100644 --- a/theme/settings.svg +++ b/theme/settings.svg @@ -1,7 +1,7 @@ - - - - - + + + /svg/icon/service/settings/default + + - + \ No newline at end of file From ff0d86748e2685b376a474647af432f21444ed50 Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 27 Oct 2025 14:49:19 +0100 Subject: [PATCH 02/14] updated gui cmake file --- src/gui/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index f77785092d1d1..3101819a7011a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,9 +6,6 @@ find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick Qui find_package(KF6Archive REQUIRED) find_package(KF6GuiAddons) -#NMC customization: needed to find the ui file in a different location than the header file -set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") - if(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-DQT_QML_DEBUG) endif() @@ -26,6 +23,9 @@ endif() configure_file(${CMAKE_SOURCE_DIR}/theme.qrc.in ${CMAKE_SOURCE_DIR}/theme.qrc) set(theme_dir ${CMAKE_SOURCE_DIR}/theme) +#NMC customization: needed to find the ui file in a different location than the header file +set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/src/gui") + set(client_UI_SRCS accountsettings.ui conflictdialog.ui From 8b16d621ed39182af21cd0fbeea29aad8fe3560c Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 26 May 2026 12:16:59 +0200 Subject: [PATCH 03/14] fix error --- src/gui/nmcgui/nmcsettingsdialog.cpp | 44 ++++++++++++++++++---------- src/gui/settingsdialog.cpp | 1 - 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp index 2ed349e7f1018..19be1b636ee0b 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.cpp +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -50,7 +50,6 @@ void OCC::NMCSettingsDialog::setLayout() const for(auto *action : actions) { if((action->text() == QCoreApplication::translate("OCC::SettingsDialog","General") || action->text() == QCoreApplication::tr("General")) || - (action->text() == QCoreApplication::translate("OCC::SettingsDialog","Network") || action->text() == QCoreApplication::tr("Network")) || (action->text() == QCoreApplication::translate("OCC::SettingsDialog","Account") || action->text() == QCoreApplication::tr("Account"))) { auto *widget = getToolBar()->widgetForAction(action); @@ -68,27 +67,40 @@ void OCC::NMCSettingsDialog::setLayout() const void NMCSettingsDialog::fixAccountButton() const { - auto toolbar = getToolBar(); + auto *toolbar = getToolBar(); + if (!toolbar) { + return; + } + + const auto actions = toolbar->actions(); + if (actions.isEmpty()) { + return; + } - // Sicher prüfen, ob ein Spacer schon existiert - auto *firstAction = toolbar->actions().at(0); - auto *firstWidget = toolbar->widgetForAction(firstAction); - if (!firstWidget || !firstWidget->objectName().startsWith("spacer_left")) { + bool hasLeftSpacer = false; + for (const auto *action : actions) { + const auto *widget = toolbar->widgetForAction(action); + if (widget && widget->objectName() == QLatin1String("spacer_left")) { + hasLeftSpacer = true; + break; + } + } + + if (!hasLeftSpacer) { auto *spacer = new QWidget(toolbar); spacer->setFixedWidth(16); - spacer->setObjectName("spacer_left"); + spacer->setObjectName(QStringLiteral("spacer_left")); spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); - toolbar->insertWidget(firstAction, spacer); + toolbar->insertWidget(actions.first(), spacer); } - // Account-Button anpassen - if (toolbar->actions().size() > 1) { - auto action = toolbar->actions().at(1); // Index 1, da davor Spacer - auto *widget = toolbar->widgetForAction(action); - if(widget) - { - widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - widget->setFixedSize(152, 76); + for (auto *action : toolbar->actions()) { + if (action->text() == QCoreApplication::translate("OCC::SettingsDialog", "Account") + || action->text() == QCoreApplication::tr("Account")) { + if (auto *widget = toolbar->widgetForAction(action)) { + widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + widget->setFixedSize(152, 76); + } } } } diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 6a361a981a521..e4f18eb18f290 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -5,7 +5,6 @@ */ #include "settingsdialog.h" -#include "ui_settingsdialog.h" #include "QtWidgets/qmainwindow.h" #include "folderman.h" From a955193997b599136336a3890dbf14174e095df9 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 26 May 2026 13:54:11 +0200 Subject: [PATCH 04/14] fix error --- src/gui/nmcgui/nmcsettingsdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp index 19be1b636ee0b..5f5cba206fed9 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.cpp +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -78,8 +78,8 @@ void NMCSettingsDialog::fixAccountButton() const } bool hasLeftSpacer = false; - for (const auto *action : actions) { - const auto *widget = toolbar->widgetForAction(action); + for (auto *action : actions) { + auto *widget = toolbar->widgetForAction(action); if (widget && widget->objectName() == QLatin1String("spacer_left")) { hasLeftSpacer = true; break; From 99451a4cacbee0b3e8cf43203478e7a04368c0e4 Mon Sep 17 00:00:00 2001 From: memurats Date: Mon, 1 Jun 2026 14:49:04 +0200 Subject: [PATCH 05/14] remove layout changes --- src/gui/nmcgui/nmcsettingsdialog.cpp | 61 +--------------------------- src/gui/nmcgui/nmcsettingsdialog.h | 5 --- 2 files changed, 1 insertion(+), 65 deletions(-) diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp index 5f5cba206fed9..91463d2ff3ca3 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.cpp +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -23,17 +23,7 @@ namespace OCC { NMCSettingsDialog::NMCSettingsDialog(ownCloudGui *gui, QWidget *parent) : SettingsDialog(gui, parent) { - setLayout(); - - // The window has no background widget, use palette - // QPalette palette; - // palette.setColor(QPalette::Window, QColor("#F3f3f3")); - // setPalette(palette); - - setFixedSize(760,760); - - getToolBar()->setFixedHeight(92); // 76px button height + 8 + 8 margin top and bottom - getToolBar()->setContentsMargins(8, 0, 8, 0); // Left margin not accepted, Qt bug? + fixAccountButton(); } void NMCSettingsDialog::slotAccountAvatarChanged() @@ -43,28 +33,6 @@ void NMCSettingsDialog::slotAccountAvatarChanged() fixAccountButton(); } -void OCC::NMCSettingsDialog::setLayout() const -{ - //Fix network and general settings button size - const auto actions = getToolBar()->actions(); - for(auto *action : actions) - { - if((action->text() == QCoreApplication::translate("OCC::SettingsDialog","General") || action->text() == QCoreApplication::tr("General")) || - (action->text() == QCoreApplication::translate("OCC::SettingsDialog","Account") || action->text() == QCoreApplication::tr("Account"))) - { - auto *widget = getToolBar()->widgetForAction(action); - if(widget) - { - widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - widget->setFixedSize(76, 76); - } - } - } - - //Fix initial account button size and stylesheet - fixAccountButton(); -} - void NMCSettingsDialog::fixAccountButton() const { auto *toolbar = getToolBar(); @@ -76,33 +44,6 @@ void NMCSettingsDialog::fixAccountButton() const if (actions.isEmpty()) { return; } - - bool hasLeftSpacer = false; - for (auto *action : actions) { - auto *widget = toolbar->widgetForAction(action); - if (widget && widget->objectName() == QLatin1String("spacer_left")) { - hasLeftSpacer = true; - break; - } - } - - if (!hasLeftSpacer) { - auto *spacer = new QWidget(toolbar); - spacer->setFixedWidth(16); - spacer->setObjectName(QStringLiteral("spacer_left")); - spacer->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); - toolbar->insertWidget(actions.first(), spacer); - } - - for (auto *action : toolbar->actions()) { - if (action->text() == QCoreApplication::translate("OCC::SettingsDialog", "Account") - || action->text() == QCoreApplication::tr("Account")) { - if (auto *widget = toolbar->widgetForAction(action)) { - widget->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - widget->setFixedSize(152, 76); - } - } - } } } // namespace OCC diff --git a/src/gui/nmcgui/nmcsettingsdialog.h b/src/gui/nmcgui/nmcsettingsdialog.h index 2e917e809d8f6..88fce09e4b910 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.h +++ b/src/gui/nmcgui/nmcsettingsdialog.h @@ -53,11 +53,6 @@ public slots: void slotAccountAvatarChanged(); // NMCGuiInterface interface -protected: - /** - * @brief Sets the layout for the NMCSettingsDialog - */ - void setLayout() const; private: /** From e3393282d383a2bca1efa94d8e57d422bcdbff37 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 09:52:16 +0200 Subject: [PATCH 06/14] fix layout --- src/gui/nmcgui/nmcsettingsdialog.cpp | 1 + src/gui/settingsdialog.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp index 91463d2ff3ca3..7a6be6b4625d7 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.cpp +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -23,6 +23,7 @@ namespace OCC { NMCSettingsDialog::NMCSettingsDialog(ownCloudGui *gui, QWidget *parent) : SettingsDialog(gui, parent) { + getToolBar()->setIconSize(QSize(24, 24)); fixAccountButton(); } diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index e4f18eb18f290..baee54609ad01 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -93,7 +93,7 @@ class CurrentPageSizeStackedWidget : public QStackedWidget constexpr auto TOOLBAR_CSS = QLatin1String( "QToolBar { background: transparent; margin: 0; padding: 0; border: none; spacing: 0; } " - "QToolBar QToolButton { background: transparent; border: none; margin: 0; padding: 8px 12px; font-size: 14px; border-radius: 8px; } " + "QToolBar QToolButton { background: transparent; border: none; margin: 0 0 8px; padding: 8px 12px; font-size: 14px; border-radius: 8px; } " "QToolBar QToolBarExtension { padding: 0; } " "QToolBar QToolButton:checked { background: palette(highlight); color: palette(highlighted-text); }" ); From 81c94bbb078e2dca571af508c11e97ce587ff455 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 12:49:18 +0200 Subject: [PATCH 07/14] fix sidebar --- src/gui/nmcgui/nmcsettingsdialog.cpp | 1 - src/gui/settingsdialog.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp index 7a6be6b4625d7..91463d2ff3ca3 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.cpp +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -23,7 +23,6 @@ namespace OCC { NMCSettingsDialog::NMCSettingsDialog(ownCloudGui *gui, QWidget *parent) : SettingsDialog(gui, parent) { - getToolBar()->setIconSize(QSize(24, 24)); fixAccountButton(); } diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index baee54609ad01..db6a3954072e4 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -187,7 +187,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) auto *accountSpacer = new QWidget(this); accountSpacer->setFixedHeight(16); _toolBar->addWidget(accountSpacer); - _toolBar->addSeparator(); + // _toolBar->addSeparator(); auto *generalSettings = new GeneralSettings; _stack->addWidget(generalSettings); _stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); @@ -558,7 +558,7 @@ void SettingsDialog::setupUi() setLayout(mainLayout); _toolBar = new QToolBar; - _toolBar->setIconSize(QSize(32, 32)); + _toolBar->setIconSize(QSize(24, 24)); _toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); _toolBar->setOrientation(Qt::Vertical); _toolBar->setMovable(false); From ef76de8b32070a17794e6aabf739c18a565ea6eb Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Tue, 2 Jun 2026 15:05:21 +0200 Subject: [PATCH 08/14] Refactor toolbar actions and remove spacer widget Removed spacer widget and adjusted account action tooltip and insertion method. --- src/gui/settingsdialog.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index db6a3954072e4..3d0392afd67ce 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -192,12 +192,6 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) _stack->addWidget(generalSettings); _stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); - // Adds space between general and network actions - auto *spacer2 = new QWidget(); - spacer2->setFixedWidth(8); - spacer2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - _toolBar->addWidget(spacer2); - // Connect styleChanged events to our widgets, so they can adapt (Dark-/Light-Mode switching) connect(this, &SettingsDialog::styleChanged, generalSettings, &GeneralSettings::slotStyleChanged); @@ -346,11 +340,11 @@ void SettingsDialog::accountAdded(AccountState *s) updateAccountAvatar(s->account().data()); if (!brandingSingleAccount) { - accountAction->setToolTip(shortDisplayNameForSettings(s->account().data(), static_cast(height * buttonSizeRatio))); + accountAction->setToolTip(s->account()->displayName()); accountAction->setIconText(shortDisplayNameForSettings(s->account().data(), static_cast(height * buttonSizeRatio))); } - _toolBar->addAction(accountAction); + _toolBar->insertAction(_toolBar->actions().at(0), accountAction); auto accountSettings = new AccountSettings(s, this); QString objectName = QLatin1String("accountSettings_"); objectName += s->account()->displayName(); From 3b2c253f7da1fbfc0aa1c8328a0dafd7fcb872b5 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Tue, 2 Jun 2026 15:15:36 +0200 Subject: [PATCH 09/14] Update settingsdialog.cpp --- src/gui/settingsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 3d0392afd67ce..131bbe5431d99 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -187,7 +187,7 @@ SettingsDialog::SettingsDialog(ownCloudGui *gui, QWidget *parent) auto *accountSpacer = new QWidget(this); accountSpacer->setFixedHeight(16); _toolBar->addWidget(accountSpacer); - // _toolBar->addSeparator(); + _toolBar->addSeparator(); auto *generalSettings = new GeneralSettings; _stack->addWidget(generalSettings); _stack->setStyleSheet(QStringLiteral("QStackedWidget { background: transparent; }")); From 8ef251a6942968e6e2e3a99560c6632ef7074e37 Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Tue, 2 Jun 2026 15:32:16 +0200 Subject: [PATCH 10/14] Remove unnecessary QMainWindow include --- src/gui/settingsdialog.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 131bbe5431d99..41b5b9da91ace 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -5,7 +5,6 @@ */ #include "settingsdialog.h" -#include "QtWidgets/qmainwindow.h" #include "folderman.h" #include "theme.h" From 31e617ffaf647feb6ca27240664dcda9b4fb53ed Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Tue, 2 Jun 2026 16:00:21 +0200 Subject: [PATCH 11/14] Update settingsdialog.cpp --- src/gui/settingsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 41b5b9da91ace..720b665c037ce 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -343,7 +343,7 @@ void SettingsDialog::accountAdded(AccountState *s) accountAction->setIconText(shortDisplayNameForSettings(s->account().data(), static_cast(height * buttonSizeRatio))); } - _toolBar->insertAction(_toolBar->actions().at(0), accountAction); + _toolBar->addAction(accountAction); auto accountSettings = new AccountSettings(s, this); QString objectName = QLatin1String("accountSettings_"); objectName += s->account()->displayName(); From 0ee404c7ba860429bf8d0031a76fe74ff31ec34f Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 2 Jun 2026 18:10:00 +0200 Subject: [PATCH 12/14] changed settings dialog default size --- src/gui/settingsdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index 720b665c037ce..b930586ca1f2f 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -98,8 +98,8 @@ constexpr auto TOOLBAR_CSS = QLatin1String( ); const float buttonSizeRatio = 1.618f; // golden ratio -constexpr auto settingsDialogDefaultWidth = 950; -constexpr auto settingsDialogDefaultHeight = 500; +constexpr auto settingsDialogDefaultWidth = 1024; +constexpr auto settingsDialogDefaultHeight = 640; /** display name with two lines that is displayed in the settings * If width is bigger than 0, the string will be ellided so it does not exceed that width From 966691d0f27c2e327212186f2470bcf85e989e4b Mon Sep 17 00:00:00 2001 From: Mauro Mura Date: Thu, 25 Jun 2026 12:37:20 +0200 Subject: [PATCH 13/14] Change default height of settings dialog to 666 --- src/gui/settingsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index b930586ca1f2f..e411edc83781a 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -99,7 +99,7 @@ constexpr auto TOOLBAR_CSS = QLatin1String( const float buttonSizeRatio = 1.618f; // golden ratio constexpr auto settingsDialogDefaultWidth = 1024; -constexpr auto settingsDialogDefaultHeight = 640; +constexpr auto settingsDialogDefaultHeight = 666; /** display name with two lines that is displayed in the settings * If width is bigger than 0, the string will be ellided so it does not exceed that width From 11d44a736750c390f92367bea4054608ad3b7365 Mon Sep 17 00:00:00 2001 From: memurats Date: Tue, 30 Jun 2026 08:53:47 +0200 Subject: [PATCH 14/14] fix main settings dialog background --- src/gui/nmcgui/nmcsettingsdialog.cpp | 37 +++++++++++++++++++++++----- src/gui/nmcgui/nmcsettingsdialog.h | 4 +++ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/gui/nmcgui/nmcsettingsdialog.cpp b/src/gui/nmcgui/nmcsettingsdialog.cpp index 91463d2ff3ca3..51e2e2fbabdf4 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.cpp +++ b/src/gui/nmcgui/nmcsettingsdialog.cpp @@ -13,23 +13,22 @@ */ #include "nmcsettingsdialog.h" -#include -#include -#include #include "settingsdialog.h" +#include +#include + namespace OCC { NMCSettingsDialog::NMCSettingsDialog(ownCloudGui *gui, QWidget *parent) : SettingsDialog(gui, parent) { fixAccountButton(); + fixNavigationBackground(); } void NMCSettingsDialog::slotAccountAvatarChanged() { - //Intercept the base class slot, so the round avatar is not set. (dont pass to base class) - //Fix Account button size, for ech new created account fixAccountButton(); } @@ -46,4 +45,30 @@ void NMCSettingsDialog::fixAccountButton() const } } -} // namespace OCC +void NMCSettingsDialog::fixNavigationBackground() const +{ + auto *navigationScroll = findChild(QStringLiteral("settings_navigation_scroll")); + if (!navigationScroll) { + return; + } + + navigationScroll->setAttribute(Qt::WA_StyledBackground, true); + navigationScroll->setStyleSheet(QStringLiteral( + "QScrollArea#settings_navigation_scroll {" + " background: palette(light);" + " border-radius: 10px;" + " border: none;" + " padding: 4px;" + "}" + "QScrollArea#settings_navigation_scroll > QWidget > QWidget {" + " background: transparent;" + "}" + )); + + if (navigationScroll->viewport()) { + navigationScroll->viewport()->setAutoFillBackground(false); + navigationScroll->viewport()->setStyleSheet(QStringLiteral("background: transparent;")); + } +} + +} // namespace OCC \ No newline at end of file diff --git a/src/gui/nmcgui/nmcsettingsdialog.h b/src/gui/nmcgui/nmcsettingsdialog.h index 88fce09e4b910..e643cff949f06 100644 --- a/src/gui/nmcgui/nmcsettingsdialog.h +++ b/src/gui/nmcgui/nmcsettingsdialog.h @@ -59,6 +59,10 @@ public slots: * @brief Fixes the appearance of the account button */ void fixAccountButton() const; + /** + * @brief Fixes the appearance of the navigation background + */ + void fixNavigationBackground() const; }; } // namespace OCC