From 34620f3246c6b31713fd0ced517dd68c2ef8b900 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 19 Apr 2025 20:04:00 -0700 Subject: [PATCH] Auto-set focus on keybind dialog --- src/config.c | 2 -- src/qt/qt_keybind.cpp | 6 ++++++ src/qt/qt_keybind.hpp | 1 + src/qt/qt_mainwindow.cpp | 1 - src/qt/qt_settingsinput.cpp | 1 - 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/config.c b/src/config.c index d537711d9..2bea312a9 100644 --- a/src/config.c +++ b/src/config.c @@ -2558,10 +2558,8 @@ save_keybinds(void) for(int x=0;xformLayout->addRow(seq); seq->setObjectName("keySequence"); + this->setTabOrder(seq, ui->buttonBox); } KeyBinder::~KeyBinder() @@ -72,6 +73,11 @@ KeyBinder::~KeyBinder() delete ui; } +void +KeyBinder::showEvent( QShowEvent* event ) { + QWidget::showEvent( event ); + this->findChild()->setFocus(); +} bool KeyBinder::eventFilter(QObject *obj, QEvent *event) { diff --git a/src/qt/qt_keybind.hpp b/src/qt/qt_keybind.hpp index afb750794..e8e7b6e5e 100644 --- a/src/qt/qt_keybind.hpp +++ b/src/qt/qt_keybind.hpp @@ -27,6 +27,7 @@ public: private: Ui::KeyBinder *ui; bool eventFilter(QObject *obj, QEvent *event); + void showEvent( QShowEvent* event ); }; #endif // QT_KeyBinder_HPP diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index ed9bf92a7..9fa38bfb1 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1079,7 +1079,6 @@ MainWindow::on_actionSettings_triggered() case QDialog::Accepted: settings.save(); config_changed = 2; - printf("about to try\n"); updateShortcuts(); pc_reset_hard(); break; diff --git a/src/qt/qt_settingsinput.cpp b/src/qt/qt_settingsinput.cpp index 924594083..aa232df67 100644 --- a/src/qt/qt_settingsinput.cpp +++ b/src/qt/qt_settingsinput.cpp @@ -74,7 +74,6 @@ SettingsInput::SettingsInput(QWidget *parent) // Make a working copy of acc_keys so we can check for dupes later without getting // confused - printf("Instantiating list\n"); for(int x=0;x