ensure that non-drag track height changes cause a call to Editor::redisplay_track_views()

This commit is contained in:
Paul Davis 2022-04-05 20:50:44 -06:00
parent d01ad0b4d4
commit a3c5db5d51
12 changed files with 28 additions and 16 deletions

View File

@ -529,13 +529,13 @@ AutomationTimeAxisView::clear_clicked ()
}
void
AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
AutomationTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{
bool const changed = (height != (uint32_t) h) || first_call_to_set_height;
uint32_t const normal = preset_height (HeightNormal);
bool const changed_between_small_and_normal = ( (height < normal && h >= normal) || (height >= normal || h < normal) );
TimeAxisView::set_height (h, m);
TimeAxisView::set_height (h, m, from_idle);
_base_rect->set_y1 (h);

View File

@ -78,7 +78,7 @@ public:
~AutomationTimeAxisView();
virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf);
virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf, bool from_idle = false);
void set_samples_per_pixel (double);
std::string name() const { return _name; }
Gdk::Color color () const;

View File

@ -7929,6 +7929,12 @@ Editor::set_track_height (Height h)
for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
(*x)->set_height_enum (h);
}
/* when not setting height from a drag, nothing will cause a redisplay
of the non-altered tracks. Do that explicitly.
*/
queue_redisplay_track_views ();
}
void

View File

@ -571,7 +571,7 @@ MidiTimeAxisView::update_midi_controls_visibility (uint32_t h)
}
void
MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{
update_midi_controls_visibility (h);
@ -588,7 +588,7 @@ MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
* which needs to know if we have just shown or hidden a scroomer /
* piano roll.
*/
RouteTimeAxisView::set_height (h, m);
RouteTimeAxisView::set_height (h, m, from_idle);
}
void

View File

@ -85,7 +85,7 @@ public:
MidiStreamView* midi_view();
void set_height (uint32_t, TrackHeightMode m = OnlySelf);
void set_height (uint32_t, TrackHeightMode m = OnlySelf, bool from_idle = false);
void set_layer_display (LayerDisplay d);
boost::shared_ptr<ARDOUR::MidiRegion> add_region (Temporal::timepos_t const &, Temporal::timecnt_t const &, bool);

View File

@ -550,6 +550,8 @@ public:
virtual bool should_ripple () const = 0;
virtual void queue_redisplay_track_views () = 0;
/// Singleton instance, set up by Editor::Editor()
static PublicEditor* _instance;

View File

@ -959,7 +959,7 @@ RouteTimeAxisView::show_selection (TimeSelection& ts)
}
void
RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{
int gmlen = h - 9;
bool height_changed = (height == 0) || (h != height);
@ -970,7 +970,7 @@ RouteTimeAxisView::set_height (uint32_t h, TrackHeightMode m)
}
gm.get_level_meter().setup_meters (gmlen, meter_width);
TimeAxisView::set_height (h, m);
TimeAxisView::set_height (h, m, from_idle);
if (_view) {
_view->set_height ((double) current_height());

View File

@ -94,7 +94,7 @@ public:
void set_button_names ();
void set_samples_per_pixel (double);
void set_height (uint32_t h, TrackHeightMode m = OnlySelf);
void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false);
void show_timestretch (Temporal::timepos_t const & start, Temporal::timepos_t const & end, int layers, int layer);
void hide_timestretch ();
void selection_click (GdkEventButton*);

View File

@ -446,10 +446,9 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
void
TimeAxisView::idle_resize (int32_t h)
{
set_height (std::max(0, h));
set_height (std::max(0, h), OnlySelf, true);
}
bool
TimeAxisView::controls_ebox_motion (GdkEventMotion* ev)
{
@ -600,7 +599,7 @@ TimeAxisView::set_height_enum (Height h, bool apply_to_selection)
}
void
TimeAxisView::set_height (uint32_t h, TrackHeightMode m)
TimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{
uint32_t lanes = 0;
if (m == TotalHeight) {
@ -637,6 +636,10 @@ TimeAxisView::set_height (uint32_t h, TrackHeightMode m)
}
_editor.override_visible_track_count ();
if (!from_idle) {
_editor.queue_redisplay_track_views ();
}
}
void

View File

@ -159,7 +159,7 @@ public:
HeightPerLane
};
virtual void set_height (uint32_t h, TrackHeightMode m = OnlySelf);
virtual void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false);
void set_height_enum (Height, bool apply_to_selection = false);
void reset_height();

View File

@ -354,9 +354,10 @@ VCATimeAxisView::color () const
}
void
VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m)
VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m, bool from_idle)
{
TimeAxisView::set_height (h, m);
TimeAxisView::set_height (h, m, from_idle);
if (height >= preset_height (HeightNormal)) {
drop_button.show ();
automation_button.show ();

View File

@ -51,7 +51,7 @@ public:
Gdk::Color color () const;
std::string state_id() const;
void set_height (uint32_t h, TrackHeightMode m = OnlySelf);
void set_height (uint32_t h, TrackHeightMode m = OnlySelf, bool from_idle = false);
bool marked_for_display () const;
bool set_marked_for_display (bool);