┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/dolphinsettingsdialog.cpp
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2024-08-15 19:56:39 +0200
committerFelix Ernst <[email protected]>2024-08-16 09:45:58 +0000
commit9e98b66e6b3b86556e6a942b2231e33e575ea25f (patch)
treeea403cab727ed6354199dfaaf5a03b97983c73c9 /src/settings/dolphinsettingsdialog.cpp
parent68f1401ecf232ccdca54362d032a547b1ec5f48a (diff)
DolphinSettingsDialog: Move focus to Okay button last
This commit changes the Tab order in Dolphin's Configure dialog so that the items which are visually at the end of the dialog are also last in the keyboard focus order when cycling through the interface using the Tab key. Previously, the "Cancel", "Defaults", "Okay", and "Apply" buttons received focus prior to the actual contents of the pages which does not make sense from a workflow perspective. This change should also make navigating this dialog easier when relying on screen readers because reading those buttons out prior to users even having a chance to change any setting did not make any sense.
Diffstat (limited to 'src/settings/dolphinsettingsdialog.cpp')
-rw-r--r--src/settings/dolphinsettingsdialog.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp
index c564dd196..782a03ae9 100644
--- a/src/settings/dolphinsettingsdialog.cpp
+++ b/src/settings/dolphinsettingsdialog.cpp
@@ -39,14 +39,6 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl &url, QWidget *parent, K
setFaceType(List);
setWindowTitle(i18nc("@title:window", "Configure"));
- QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
- box->button(QDialogButtonBox::Apply)->setEnabled(false);
- box->button(QDialogButtonBox::Ok)->setDefault(true);
- setButtonBox(box);
-
- connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
- connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
- connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults);
// Interface
InterfaceSettingsPage *interfaceSettingsPage = new InterfaceSettingsPage(this);
@@ -112,6 +104,16 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl &url, QWidget *parent, K
}
#endif
+ // Create the buttons last so they are also last in the keyboard Tab focus order.
+ QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
+ box->button(QDialogButtonBox::Apply)->setEnabled(false);
+ box->button(QDialogButtonBox::Ok)->setDefault(true);
+ setButtonBox(box);
+
+ connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+ connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+ connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults);
+
const KConfigGroup dialogConfig(KSharedConfig::openStateConfig(), QStringLiteral("SettingsDialog"));
KWindowConfig::restoreWindowSize(windowHandle(), dialogConfig);
}