From 276f3e1d984bdb17403ae46464bed89c6b5b841b Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 18 Jul 2020 09:56:33 -0400 Subject: [PATCH] [SettingDialog] CTRL+F now selects the Find input (#1811) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sneakily make SettingsDialog constructor private at the same time 🕵 --- CHANGELOG.md | 1 + src/widgets/dialogs/SettingsDialog.cpp | 6 ++++++ src/widgets/dialogs/SettingsDialog.hpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e93db8d4..f4b4ee958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Minor: BetterTTV / FrankerFaceZ emote tooltips now also have emote authors' name (#1721) - Minor: Emotes in the emote popup are now sorted in the same order as the tab completion (#1549) - Minor: Removed "Online Logs" functionality as services are shut down (#1640) +- Minor: CTRL+F now selects the Find text input field in the Settings Dialog (#1806 #1811) - Bugfix: Fix preview on hover not working when Animated emotes options was disabled (#1546) - Bugfix: FFZ custom mod badges no longer scale with the emote scale options (#1602) - Bugfix: MacOS updater looked for non-existing fields, causing it to always fail the update check (#1642) diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index 7effdb892..f64656213 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -3,6 +3,7 @@ #include "Application.hpp" #include "singletons/Resources.hpp" #include "util/LayoutCreator.hpp" +#include "util/Shortcut.hpp" #include "widgets/helper/Button.hpp" #include "widgets/settingspages/AboutPage.hpp" #include "widgets/settingspages/AccountsPage.hpp" @@ -32,6 +33,11 @@ SettingsDialog::SettingsDialog() this->addTabs(); this->overrideBackgroundColor_ = QColor("#111111"); this->scaleChangedEvent(this->scale()); // execute twice to width of item + + createWindowShortcut(this, "CTRL+F", [this] { + this->ui_.search->setFocus(); + this->ui_.search->selectAll(); + }); } void SettingsDialog::initUi() diff --git a/src/widgets/dialogs/SettingsDialog.hpp b/src/widgets/dialogs/SettingsDialog.hpp index 0d08f7c9f..fa7449ab0 100644 --- a/src/widgets/dialogs/SettingsDialog.hpp +++ b/src/widgets/dialogs/SettingsDialog.hpp @@ -31,9 +31,9 @@ enum class SettingsDialogPreference { class SettingsDialog : public BaseWindow { -public: SettingsDialog(); +public: static void showDialog(SettingsDialogPreference preferredTab = SettingsDialogPreference::NoPreference);