13
0

redraw summary when theme preference changes & consolidate code.

This commit is contained in:
Robin Gareus 2014-10-29 16:07:13 +01:00
parent fdedf7153e
commit 1d0612ceb6
2 changed files with 16 additions and 6 deletions

View 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 ();
}
}

View 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 {