Added a Scroll to top keyboard shortcut for splits (#3802)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user