From b266512904d6ffb8e8e8ec4ca4f7256119518b68 Mon Sep 17 00:00:00 2001 From: tsujan Date: Sun, 13 Mar 2022 11:55:13 +0330 Subject: [PATCH] Fixed Reset button in taskbar config dialog (#1742) Related to https://github.com/lxqt/lxqt-panel/issues/1741 --- plugin-taskbar/lxqttaskbarconfiguration.cpp | 9 +++++++++ plugin-taskbar/lxqttaskbarconfiguration.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/plugin-taskbar/lxqttaskbarconfiguration.cpp b/plugin-taskbar/lxqttaskbarconfiguration.cpp index 25fe551ff..db3645378 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.cpp +++ b/plugin-taskbar/lxqttaskbarconfiguration.cpp @@ -131,3 +131,12 @@ void LXQtTaskbarConfiguration::saveSettings() settings().setValue(QStringLiteral("wheelEventsAction"),ui->wheelEventsActionCB->itemData(ui->wheelEventsActionCB->currentIndex())); settings().setValue(QStringLiteral("wheelDeltaThreshold"),ui->wheelDeltaThresholdSB->value()); } + +void LXQtTaskbarConfiguration::dialogButtonsAction(QAbstractButton *btn) +{ + LXQtPanelPluginConfigDialog::dialogButtonsAction(btn); + // also, apply the changes if the Reset button is clicked + QDialogButtonBox *box = qobject_cast(btn->parent()); + if (box && box->buttonRole(btn) == QDialogButtonBox::ResetRole) + saveSettings(); +} diff --git a/plugin-taskbar/lxqttaskbarconfiguration.h b/plugin-taskbar/lxqttaskbarconfiguration.h index e559508b7..b42f0a99e 100644 --- a/plugin-taskbar/lxqttaskbarconfiguration.h +++ b/plugin-taskbar/lxqttaskbarconfiguration.h @@ -52,6 +52,8 @@ class LXQtTaskbarConfiguration : public LXQtPanelPluginConfigDialog */ void loadSettings(); + void dialogButtonsAction(QAbstractButton *btn); + private slots: void saveSettings(); };