redraw summary when theme preference changes & consolidate code.
authorRobin Gareus <robin@gareus.org>
Wed, 29 Oct 2014 15:07:13 +0000 (16:07 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 29 Oct 2014 15:07:13 +0000 (16:07 +0100)
gtk2_ardour/editor_summary.cc
gtk2_ardour/editor_summary.h

index 85aed8291f66973f794b4f7eac2322485ac996d5..cc9f1a6783b683bd121f8fc60a0eac61a22b7e0c 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "canvas/debug.h"
 
+#include "ardour_ui.h"
 #include "time_axis_view.h"
 #include "streamview.h"
 #include "editor_summary.h"
@@ -60,6 +61,8 @@ EditorSummary::EditorSummary (Editor* e)
 {
        add_events (Gdk::POINTER_MOTION_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
        set_flags (get_flags() | Gtk::CAN_FOCUS);
+
+       ARDOUR_UI::config()->ParameterChanged.connect (sigc::mem_fun (*this, &EditorSummary::parameter_changed));
 }
 
 EditorSummary::~EditorSummary ()
@@ -67,6 +70,15 @@ EditorSummary::~EditorSummary ()
        cairo_surface_destroy (_image);
 }
 
+void
+EditorSummary::parameter_changed (string p)
+{
+
+       if (p == "color-regions-using-track-color") {
+               set_background_dirty ();
+       }
+}
+
 /** Handle a size allocation.
  *  @param alloc GTK allocation.
  */
@@ -74,8 +86,7 @@ void
 EditorSummary::on_size_allocate (Gtk::Allocation& alloc)
 {
        CairoWidget::on_size_allocate (alloc);
-       _background_dirty = true;
-       set_dirty ();
+       set_background_dirty ();
 }
 
 
@@ -1035,16 +1046,14 @@ EditorSummary::routes_added (list<RouteTimeAxisView*> const & r)
                }
        }
 
-       _background_dirty = true;
-       set_dirty ();
+       set_background_dirty ();
 }
 
 void
 EditorSummary::route_gui_changed (string c)
 {
        if (c == "color") {
-               _background_dirty = true;
-               set_dirty ();
+               set_background_dirty ();
        }
 }
 
index f2e4eb08c40e3519434dca7ce6a8137dcfc95d88..588f7c0ed2fd691782a42c5a0cf48dd21e2ff5e9 100644 (file)
@@ -44,6 +44,7 @@ public:
        void routes_added (std::list<RouteTimeAxisView*> const &);
 
 private:
+       void parameter_changed (std::string);
        void on_size_allocate (Gtk::Allocation& alloc);
 
        enum Position {