From 454ea277eb13fdf6050bd8323422e59b15c439c0 Mon Sep 17 00:00:00 2001 From: VioletGiraffe Date: Sun, 5 Feb 2023 15:20:34 +0200 Subject: [PATCH] https://github.com/VioletGiraffe/file-commander/issues/298 partially fixed --- settingsui/csettingsdialog.cpp | 10 +++++++++- settingsui/csettingsdialog.ui | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/settingsui/csettingsdialog.cpp b/settingsui/csettingsdialog.cpp index 0d9fae7..0952ff3 100644 --- a/settingsui/csettingsdialog.cpp +++ b/settingsui/csettingsdialog.cpp @@ -19,10 +19,13 @@ CSettingsDialog::CSettingsDialog(QWidget *parent) : ui->splitter->setStretchFactor(0, 0); ui->splitter->setStretchFactor(1, 1); - connect(ui->pageList, &QListWidget::itemClicked, this, &CSettingsDialog::pageChanged); + connect(ui->pageList, &QListWidget::currentItemChanged, this, &CSettingsDialog::pageChanged); ui->pageList->setResizeMode(QListWidget::Adjust); new QShortcut(QKeySequence("Ctrl+Shift+W"), this, this, &CSettingsDialog::wipeSettings); + + ui->pageList->setFocus(); + setTabOrder(ui->pageList, nullptr); } CSettingsDialog::~CSettingsDialog() @@ -40,7 +43,12 @@ CSettingsDialog& CSettingsDialog::addSettingsPage(CSettingsPage* page, const QSt ui->pageList->addItem(item); if (ui->pages->count() == 1) + { ui->pageList->setCurrentRow(0); + setTabOrder(ui->pageList, page); + } + else + setTabOrder(ui->pages->widget(ui->pages->count() - 1), page); ui->pageList->adjustSize(); diff --git a/settingsui/csettingsdialog.ui b/settingsui/csettingsdialog.ui index c8828f1..c5d6598 100644 --- a/settingsui/csettingsdialog.ui +++ b/settingsui/csettingsdialog.ui @@ -6,7 +6,7 @@ 0 0 - 741 + 622 437 @@ -26,11 +26,21 @@ false - + + + + 50 + 0 + + + + + Qt::TabFocus + Qt::Horizontal @@ -41,6 +51,9 @@ + + pageList +