Skip to content

Commit

Permalink
Fixed Reset button in taskbar config dialog
Browse files Browse the repository at this point in the history
Related to #1741
  • Loading branch information
tsujan committed Mar 12, 2022
1 parent e3ab2ee commit 66b31e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin-taskbar/lxqttaskbarconfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<QDialogButtonBox*>(btn->parent());
if (box && box->buttonRole(btn) == QDialogButtonBox::ResetRole)
saveSettings();
}
2 changes: 2 additions & 0 deletions plugin-taskbar/lxqttaskbarconfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class LXQtTaskbarConfiguration : public LXQtPanelPluginConfigDialog
*/
void loadSettings();

void dialogButtonsAction(QAbstractButton *btn);

private slots:
void saveSettings();
};
Expand Down

0 comments on commit 66b31e5

Please sign in to comment.