curve/timeline: improved user interface behavior

* Implements "auto-fit" setting for curve view and sets it on open.
* Improves scroll zooming on all TimelineViewBase derivatives.
* Improves code sharing for better maintenance.
This commit is contained in:
itsmattkc
2020-06-23 05:25:34 +10:00
parent e681b87988
commit 8bf653925f
11 changed files with 198 additions and 82 deletions
+2 -2
View File
@@ -482,12 +482,12 @@ void TimeBasedWidget::ToggleShowAll()
w = timeline_views_.first()->width();
}
w = w / 10 * 9;
toggle_show_all_old_scale_ = GetScale();
toggle_show_all_old_scroll_ = scrollbar_->value();
SetScale(w / GetConnectedNode()->GetLength().toDouble());
SetScaleFromDimensions(w, GetConnectedNode()->GetLength().toDouble());
scrollbar_->setValue(0);
// Must explicitly do this because SetScale() will automatically set this to false