mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Added a Scroll to top
keyboard shortcut for splits (#3802)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
fd87cbb626
commit
9583b49653
|
@ -5,6 +5,7 @@
|
|||
- Major: Added multi-channel searching to search dialog via keyboard shortcut. [Ctrl+Shift+F by default] (#3694)
|
||||
- Minor: Added `is:first-msg` search option. (#3700)
|
||||
- Minor: Added quotation marks in the permitted/blocked Automod messages for clarity. (#3654)
|
||||
- Minor: Added a `Scroll to top` keyboard shortcut for splits. (#3802)
|
||||
- Minor: Adjust large stream thumbnail to 16:9 (#3655)
|
||||
- Minor: Fixed being unable to load Twitch Usercards from the `/mentions` tab. (#3623)
|
||||
- Minor: Add information about the user's operating system in the About page. (#3663)
|
||||
|
|
|
@ -89,6 +89,7 @@ inline const std::map<HotkeyCategory, ActionDefinitionMap> actionNames{
|
|||
1,
|
||||
}},
|
||||
{"scrollToBottom", ActionDefinition{"Scroll to the bottom"}},
|
||||
{"scrollToTop", ActionDefinition{"Scroll to the top"}},
|
||||
{"setChannelNotification",
|
||||
ActionDefinition{
|
||||
"Set channel live notification",
|
||||
|
|
|
@ -375,6 +375,9 @@ void HotkeyController::addDefaults(std::set<QString> &addedHotkeys)
|
|||
this->tryAddDefault(addedHotkeys, HotkeyCategory::Split,
|
||||
QKeySequence("Ctrl+End"), "scrollToBottom",
|
||||
std::vector<QString>(), "scroll to bottom");
|
||||
this->tryAddDefault(addedHotkeys, HotkeyCategory::Split,
|
||||
QKeySequence("Ctrl+Home"), "scrollToTop",
|
||||
std::vector<QString>(), "scroll to top");
|
||||
this->tryAddDefault(addedHotkeys, HotkeyCategory::Split,
|
||||
QKeySequence("F10"), "debug",
|
||||
std::vector<QString>(), "open debug popup");
|
||||
|
|
|
@ -76,6 +76,11 @@ void Scrollbar::scrollToBottom(bool animate)
|
|||
this->setDesiredValue(this->maximum_ - this->getLargeChange(), animate);
|
||||
}
|
||||
|
||||
void Scrollbar::scrollToTop(bool animate)
|
||||
{
|
||||
this->setDesiredValue(this->minimum_ - this->getLargeChange(), animate);
|
||||
}
|
||||
|
||||
bool Scrollbar::isAtBottom() const
|
||||
{
|
||||
return this->atBottom_;
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
void clearHighlights();
|
||||
|
||||
void scrollToBottom(bool animate = false);
|
||||
void scrollToTop(bool animate = false);
|
||||
bool isAtBottom() const;
|
||||
|
||||
void setMaximum(qreal value);
|
||||
|
|
|
@ -333,6 +333,12 @@ void Split::addShortcuts()
|
|||
getSettings()->enableSmoothScrollingNewMessages.getValue());
|
||||
return "";
|
||||
}},
|
||||
{"scrollToTop",
|
||||
[this](std::vector<QString>) -> QString {
|
||||
this->getChannelView().getScrollBar().scrollToTop(
|
||||
getSettings()->enableSmoothScrollingNewMessages.getValue());
|
||||
return "";
|
||||
}},
|
||||
{"scrollPage",
|
||||
[this](std::vector<QString> arguments) -> QString {
|
||||
if (arguments.size() == 0)
|
||||
|
|
Loading…
Reference in a new issue