Add PgUp / PgDown for scrolling in the emote popup (#2607)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Tal Neoran 2021-04-10 15:11:26 +03:00 committed by GitHub
parent bc334222c1
commit b0fee78f2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -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)

View file

@ -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 <QHBoxLayout>
@ -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<ChannelView *>(notebook->getSelectedPage())
->getScrollBar();
scrollbar.offset(-scrollbar.getLargeChange());
});
createWindowShortcut(this, "PgDown", [=] {
auto &scrollbar =
dynamic_cast<ChannelView *>(notebook->getSelectedPage())
->getScrollBar();
scrollbar.offset(scrollbar.getLargeChange());
});
}
void EmotePopup::loadChannel(ChannelPtr _channel)