Skip to content

Commit

Permalink
[SettingDialog] CTRL+F now selects the Find input (Chatterino#1811)
Browse files Browse the repository at this point in the history
* Sneakily make SettingsDialog constructor private at the same time 🕵
  • Loading branch information
pajlada authored Jul 18, 2020
1 parent 6ba9c5e commit 276f3e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/widgets/dialogs/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/dialogs/SettingsDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ enum class SettingsDialogPreference {

class SettingsDialog : public BaseWindow
{
public:
SettingsDialog();

public:
static void showDialog(SettingsDialogPreference preferredTab =
SettingsDialogPreference::NoPreference);

Expand Down

0 comments on commit 276f3e1

Please sign in to comment.