diff options
| author | Dentomologist <dentomologist@gmail.com> | 2021-06-05 16:29:41 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2021-06-06 09:21:41 -0700 |
| commit | 7a6098a7f655a9441b1196ef2efefd3bdaac8f8d (patch) | |
| tree | f51d4641d74a5428066b490fac5d70328de420f3 /Source/Core | |
| parent | 2f8c9a77356b8eac8fdff0e9312fe2a8896c92b5 (diff) | |
GameList: Fix grid mode zoom keybind inconsistency
Add keybind to make 'control plus' zoom in as per convention, and also
'control shift minus' zoom out to maintain consistency.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/GameList/GameList.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index 7725510c4e..15d375fa8f 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -96,12 +96,27 @@ GameList::GameList(QWidget* parent) : QStackedWidget(parent), m_model(this) m_prefer_list = Settings::Instance().GetPreferredView(); ConsiderViewChange(); - auto* zoom_in = new QShortcut(QKeySequence::ZoomIn, this); - auto* zoom_out = new QShortcut(QKeySequence::ZoomOut, this); + const auto* zoom_in = new QShortcut(QKeySequence::ZoomIn, this); + const auto* zoom_out = new QShortcut(QKeySequence::ZoomOut, this); connect(zoom_in, &QShortcut::activated, this, &GameList::ZoomIn); connect(zoom_out, &QShortcut::activated, this, &GameList::ZoomOut); + // On most keyboards the key to the left of the primary delete key represents 'plus' when shift is + // held and 'equal' when it isn't. By common convention, pressing control and that key is treated + // conceptually as 'control plus' (which is then interpreted as an appropriate zooming action) + // instead of the technically correct 'control equal'. Qt doesn't account for this convention so + // an alternate shortcut is needed to avoid counterintuitive behavior. + const auto* zoom_in_alternate = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Equal), this); + connect(zoom_in_alternate, &QShortcut::activated, this, &GameList::ZoomIn); + + // The above correction introduces a different inconsistency: now zooming in can be done using + // conceptual 'control plus' or 'control shift plus', while zooming out can only be done using + // 'control minus'. Adding an alternate shortcut representing 'control shift minus' restores + // consistency. + const auto* zoom_out_alternate = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Underscore), this); + connect(zoom_out_alternate, &QShortcut::activated, this, &GameList::ZoomOut); + connect(&Settings::Instance(), &Settings::MetadataRefreshCompleted, this, [this] { m_grid_proxy->invalidate(); }); } |
