diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 885da03652..0de714bf13 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -372,6 +372,22 @@ AudioRegionView::fade_out_active_changed () } } +uint32_t +AudioRegionView::get_fill_color () const +{ + Gtkmm2ext::Color f = TimeAxisViewItem::get_fill_color(); + char const *modname; + + const bool opaque = _region->opaque() || trackview.layer_display () == Stacked; + + if (opaque && ( !_dragging && !_region->muted () )) { + modname = "opaque region base"; + } else { + modname = "transparent region base"; + } + + return Gtkmm2ext::HSV(f).mod (UIConfiguration::instance().modifier (modname)).color (); +} void AudioRegionView::region_scale_amplitude_changed () @@ -1597,7 +1613,7 @@ AudioRegionView::set_some_waveform_colors (vector& wa } else if (_region->muted()) { outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 80); fill = UINT_INTERPOLATE(fill_color, UIConfiguration::instance().color ("covered region"), 0.7); - } else if (!_region->opaque()) { + } else if (!_region->opaque() && trackview.layer_display () != Stacked) { outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 70); fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 70); } diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 0e932f69c2..de47455321 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -116,6 +116,9 @@ public: void show_region_editor (); + void set_frame_color (); + uint32_t get_fill_color () const; + virtual void entered (); virtual void exited (); @@ -201,7 +204,6 @@ protected: void set_colors (); void set_waveform_colors (); void reset_width_dependent_items (double pixel_width); - void set_frame_color (); void color_handler (); diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 8b1a7f8f26..a09417cd8a 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -158,6 +158,16 @@ AudioStreamView::add_region_view_internal (boost::shared_ptr r, bool wai return region_view; } +void +AudioStreamView::set_layer_display (LayerDisplay d) +{ + StreamView::set_layer_display (d); + + for (auto& rv : region_views) { + rv->set_frame_color (); + } +} + void AudioStreamView::redisplay_track () { diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h index 8d600607da..3bec6ef989 100644 --- a/gtk2_ardour/audio_streamview.h +++ b/gtk2_ardour/audio_streamview.h @@ -69,6 +69,8 @@ public: void reload_waves (); + void set_layer_display (LayerDisplay); + ArdourCanvas::Container* region_canvas () const { return _region_group; } private: diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 6447b1f878..f79e068d4d 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -3687,9 +3687,11 @@ MidiRegionView::note_mouse_position (float x_fraction, float /*y_fraction*/, boo uint32_t MidiRegionView::get_fill_color() const { + const bool opaque = _region->opaque() || trackview.layer_display () == Stacked; + const std::string mod_name = _dragging ? "dragging region" : trackview.editor().internal_editing() ? "editable region" : - (_region->opaque() && !_region->muted ()) ? "opaque region base" : "transparent region base"; + (opaque && !_region->muted ()) ? "opaque region base" : "transparent region base"; if (_selected) { diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 0473930b96..9e881c97e7 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -262,6 +262,9 @@ MidiStreamView::set_layer_display (LayerDisplay d) // } StreamView::set_layer_display (d); + for (auto& rv : region_views) { + rv->set_frame_color (); + } } void diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 44e108bf1b..698cfca266 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -743,21 +743,6 @@ RegionView::set_sync_mark_color () } } -uint32_t -RegionView::get_fill_color () const -{ - Gtkmm2ext::Color f = TimeAxisViewItem::get_fill_color(); - char const *modname; - - if (_region->opaque() && ( !_dragging && !_region->muted () )) { - modname = "opaque region base"; - } else { - modname = "transparent region base"; - } - - return Gtkmm2ext::HSV(f).mod (UIConfiguration::instance().modifier (modname)).color (); -} - void RegionView::show_region_editor () { diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index cd25617c74..b76cd529b6 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -92,8 +92,6 @@ public: virtual void region_changed (const PBD::PropertyChange&); - uint32_t get_fill_color () const; - virtual GhostRegion* add_ghost (TimeAxisView&) = 0; void remove_ghost_in (TimeAxisView&); void remove_ghost (GhostRegion*); diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index aaf891bf71..9c4999f9d7 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -81,6 +81,7 @@ public: void set_color (uint32_t); void set_name_text_color (); + virtual void set_frame_color(); virtual uint32_t get_fill_color () const; ArdourCanvas::Item* get_canvas_frame(); @@ -152,7 +153,6 @@ protected: virtual bool canvas_group_event (GdkEvent*); virtual void set_colors(); - virtual void set_frame_color(); virtual void set_frame_gradient (); void set_trim_handle_colors();