Added a Scroll to top keyboard shortcut for splits (#3802)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Brian
2022-06-18 07:48:55 -04:00
committed by GitHub
parent fd87cbb626
commit 9583b49653
6 changed files with 17 additions and 0 deletions
+5
View File
@@ -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_;
+1
View File
@@ -30,6 +30,7 @@ public:
void clearHighlights();
void scrollToBottom(bool animate = false);
void scrollToTop(bool animate = false);
bool isAtBottom() const;
void setMaximum(qreal value);
+6
View File
@@ -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)