Change the background colour of regions when they are small enough to not show the...
authorCarl Hetherington <carl@carlh.net>
Tue, 8 Feb 2011 14:09:42 +0000 (14:09 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 8 Feb 2011 14:09:42 +0000 (14:09 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8771 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/midi_region_view.cc
gtk2_ardour/time_axis_view_item.cc

index 52980e727017368a9945adbcfc63abbecf470090..a95e8a05a4791a2b044c9801509cdb1fdd56524c 100644 (file)
@@ -2868,12 +2868,16 @@ MidiRegionView::note_mouse_position (float x_fraction, float /*y_fraction*/, boo
 void
 MidiRegionView::set_frame_color()
 {
-       if (frame) {
-               if (_selected) {
-                       frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
-               } else {
-                       frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiFrameBase.get();
-               }
+       if (!frame) {
+               return;
+       }
+
+       if (_selected) {
+               frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
+       } else if (high_enough_for_name) {
+               frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiFrameBase.get();
+       } else {
+               frame->property_fill_color_rgba() = fill_color;
        }
 }
 
index f0dd9a7984d79c56b064c107d8e2d663d877f0a5..8220536508e3104e6fb2a5a6c579fb44a9673c2f 100644 (file)
@@ -531,6 +531,7 @@ TimeAxisViewItem::set_height (double height)
        vestigial_frame->property_y2() = height - 1;
 
        update_name_pixbuf_visibility ();
+       set_colors ();
 }
 
 void
@@ -691,13 +692,19 @@ TimeAxisViewItem::set_frame_color()
        } else {
                if (_recregion) {
                        frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
-               } else {
+               } else if (high_enough_for_name) {
                        if (fill_opacity) {
                                frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_FrameBase.get(), fill_opacity);
                        } else {
                                frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameBase.get();
                        }
-               }
+               } else {
+                       if (fill_opacity) {
+                               frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, fill_opacity);
+                       } else {
+                               frame->property_fill_color_rgba() = fill_color;
+                       }
+               }                       
        }
 }