X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Faxis_view.cc;h=016e57945f65d07e88384a1966c85a9a92736d71;hb=7701207123891b400c144db880b77dc698a202ea;hp=41efbf86aed65ed0f8ea39eb6044bdb3144be58f;hpb=a3c378cf62939c85bcfa3b4c55b68c9163c5e21e;p=ardour.git diff --git a/gtk2_ardour/axis_view.cc b/gtk2_ardour/axis_view.cc index 41efbf86ae..016e57945f 100644 --- a/gtk2_ardour/axis_view.cc +++ b/gtk2_ardour/axis_view.cc @@ -37,7 +37,7 @@ #include "gui_object.h" #include "axis_view.h" #include "utils.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace Gtk; @@ -47,10 +47,8 @@ using namespace ARDOUR_UI_UTILS; list AxisView::used_colors; -AxisView::AxisView (ARDOUR::Session* sess) - : SessionHandlePtr (sess) +AxisView::AxisView () { - _selected = false; } AxisView::~AxisView() @@ -66,7 +64,14 @@ AxisView::unique_random_color() string AxisView::gui_property (const string& property_name) const { - return gui_object_state().get_string (state_id(), property_name); + if (property_hashtable.count(property_name)) { + return property_hashtable[property_name]; + } else { + string rv = gui_object_state().get_string (state_id(), property_name); + property_hashtable.erase(property_name); + property_hashtable.emplace(property_name, rv); + return rv; + } } bool @@ -84,12 +89,27 @@ AxisView::set_marked_for_display (bool yn) set_gui_property ("visible", yn); return true; // things changed } - return false; } GUIObjectState& -AxisView::gui_object_state() +AxisView::gui_object_state() { return *ARDOUR_UI::instance()->gui_object_state; } + +void +AxisView::set_selected (bool yn) +{ + if (selected() == yn) { + return; + } + + Selectable::set_selected (yn); + + boost::shared_ptr s = stripable (); + + if (s) { + s->presentation_info().set_selected (yn); + } +}