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:
@@ -447,7 +447,7 @@ void TimeBasedWidget::ToggleShowAll()
|
|||||||
|
|
||||||
if (toggle_show_all_) {
|
if (toggle_show_all_) {
|
||||||
SetScale(toggle_show_all_old_scale_);
|
SetScale(toggle_show_all_old_scale_);
|
||||||
toggle_show_all_ = false;
|
scrollbar_->setValue(toggle_show_all_old_scroll_);
|
||||||
} else {
|
} else {
|
||||||
int w;
|
int w;
|
||||||
|
|
||||||
@@ -460,9 +460,13 @@ void TimeBasedWidget::ToggleShowAll()
|
|||||||
w = w / 10 * 9;
|
w = w / 10 * 9;
|
||||||
|
|
||||||
toggle_show_all_old_scale_ = GetScale();
|
toggle_show_all_old_scale_ = GetScale();
|
||||||
|
toggle_show_all_old_scroll_ = scrollbar_->value();
|
||||||
|
|
||||||
SetScale(w / GetConnectedNode()->GetLength().toDouble());
|
SetScale(w / GetConnectedNode()->GetLength().toDouble());
|
||||||
toggle_show_all_ = true;
|
scrollbar_->setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggle_show_all_ = !toggle_show_all_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TimeBasedWidget::GoToIn()
|
void TimeBasedWidget::GoToIn()
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ private:
|
|||||||
bool toggle_show_all_;
|
bool toggle_show_all_;
|
||||||
|
|
||||||
double toggle_show_all_old_scale_;
|
double toggle_show_all_old_scale_;
|
||||||
|
int toggle_show_all_old_scroll_;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void UpdateMaximumScroll();
|
void UpdateMaximumScroll();
|
||||||
|
|||||||
Reference in New Issue
Block a user