From b0fee78f2b4307bf79ecabdd3073d081d6e01cbe Mon Sep 17 00:00:00 2001 From: Tal Neoran Date: Sat, 10 Apr 2021 15:11:26 +0300 Subject: [PATCH] Add PgUp / PgDown for scrolling in the emote popup (#2607) Co-authored-by: pajlada --- CHANGELOG.md | 2 +- src/widgets/dialogs/EmotePopup.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d439f8a6d..a20663931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,7 @@ - Minor: Show channels live now enabled by default - Minor: Bold usernames enabled by default - Minor: Improve UX of the "Login expired!" message (#2029) -- Minor: PageUp and PageDown now scroll in the selected split (#2070, #2081) +- Minor: PageUp and PageDown now scroll in the selected split and in the emote popup (#2070, #2081, #2410, #2607) - Minor: Allow highlights to be excluded from `/mentions`. Excluded highlights will not trigger tab highlights either. (#1793, #2036) - Minor: Flag all popup dialogs as actual dialogs so they get the relevant window manager hints (#1843, #2182, #2185, #2232, #2234) - Minor: Don't show update button for nightly builds on macOS and Linux, this was already the case for Windows (#2163, #2164) diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index df40b720e..812bbadb1 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -11,6 +11,7 @@ #include "singletons/WindowManager.hpp" #include "util/Shortcut.hpp" #include "widgets/Notebook.hpp" +#include "widgets/Scrollbar.hpp" #include "widgets/helper/ChannelView.hpp" #include @@ -178,6 +179,20 @@ EmotePopup::EmotePopup(QWidget *parent) createWindowShortcut(this, "CTRL+Shift+Tab", [=] { notebook->selectPreviousTab(); }); + + // Scroll with Page Up / Page Down + createWindowShortcut(this, "PgUp", [=] { + auto &scrollbar = + dynamic_cast(notebook->getSelectedPage()) + ->getScrollBar(); + scrollbar.offset(-scrollbar.getLargeChange()); + }); + createWindowShortcut(this, "PgDown", [=] { + auto &scrollbar = + dynamic_cast(notebook->getSelectedPage()) + ->getScrollBar(); + scrollbar.offset(scrollbar.getLargeChange()); + }); } void EmotePopup::loadChannel(ChannelPtr _channel)