Restore mixer scroll offset after spill

This commit is contained in:
Robin Gareus 2018-09-01 21:32:57 +02:00
parent 2a78f0a852
commit 67f733bb97
2 changed files with 12 additions and 0 deletions

View File

@ -106,6 +106,7 @@ Mixer_UI::Mixer_UI ()
, _monitor_section (0)
, _plugin_selector (0)
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
, _spill_scroll_position (0)
, ignore_reorder (false)
, _in_group_rebuild_or_clear (false)
, _route_deletion_in_progress (false)
@ -1450,6 +1451,9 @@ Mixer_UI::redisplay_track_list ()
if (ss) {
boost::shared_ptr<VCA> sv = boost::dynamic_pointer_cast<VCA> (ss);
if (sv) {
if (_spill_scroll_position <= 0 && scroller.get_hscrollbar()) {
_spill_scroll_position = scroller.get_hscrollbar()->get_adjustment()->get_value();
}
spill_redisplay (sv);
return;
}
@ -1541,6 +1545,13 @@ Mixer_UI::redisplay_track_list ()
}
_group_tabs->set_dirty ();
if (_spill_scroll_position > 0 && scroller.get_hscrollbar()) {
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
adj->set_value (max (adj->get_lower(), min (adj->get_upper(), _spill_scroll_position)));
}
_spill_scroll_position = 0;
}
void

View File

@ -348,6 +348,7 @@ private:
bool vca_button_release_event (GdkEventButton*, VCAMasterStrip*);
Width _strip_width;
double _spill_scroll_position;
void presentation_info_changed (PBD::PropertyChange const &);
void sync_treeview_from_presentation_info (PBD::PropertyChange const &);