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
2 changed files with 16 additions and 1 deletions
+15
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)