timebasedwidget: restore scroll when using "toggle show all"

"Toggle Show All" would restore only the scale. Now it sets/restores the
scroll as well.
This commit is contained in:
itsmattkc
2020-05-30 02:49:25 +10:00
parent 957e877b95
commit 8299acf547
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -447,7 +447,7 @@ void TimeBasedWidget::ToggleShowAll()
if (toggle_show_all_) {
SetScale(toggle_show_all_old_scale_);
toggle_show_all_ = false;
scrollbar_->setValue(toggle_show_all_old_scroll_);
} else {
int w;
@@ -460,9 +460,13 @@ void TimeBasedWidget::ToggleShowAll()
w = w / 10 * 9;
toggle_show_all_old_scale_ = GetScale();
toggle_show_all_old_scroll_ = scrollbar_->value();
SetScale(w / GetConnectedNode()->GetLength().toDouble());
toggle_show_all_ = true;
scrollbar_->setValue(0);
}
toggle_show_all_ = !toggle_show_all_;
}
void TimeBasedWidget::GoToIn()
+1
View File
@@ -168,6 +168,7 @@ private:
bool toggle_show_all_;
double toggle_show_all_old_scale_;
int toggle_show_all_old_scroll_;
private slots:
void UpdateMaximumScroll();