Small clean up of route colour setting.
authorCarl Hetherington <carl@carlh.net>
Wed, 23 Feb 2011 01:03:37 +0000 (01:03 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 23 Feb 2011 01:03:37 +0000 (01:03 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8933 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/route_time_axis.cc
gtk2_ardour/route_time_axis.h
gtk2_ardour/route_ui.cc
gtk2_ardour/route_ui.h

index 73dcf5d9a37a28677112594ce32bcb8595042432..957dfcd88fdaba9b9d497e368e4dfed2e0097c50 100644 (file)
@@ -441,7 +441,7 @@ RouteTimeAxisView::build_display_menu ()
        MenuList& items = display_menu->items();
        display_menu->set_name ("ArdourContextMenu");
 
-       items.push_back (MenuElem (_("Color..."), sigc::mem_fun(*this, &RouteTimeAxisView::select_track_color)));
+       items.push_back (MenuElem (_("Color..."), sigc::hide_return (sigc::mem_fun (*this, &RouteUI::choose_color))));
 
        build_size_menu ();
        items.push_back (MenuElem (_("Height"), *_size_menu));
@@ -863,13 +863,12 @@ RouteTimeAxisView::set_height (uint32_t h)
 }
 
 void
-RouteTimeAxisView::select_track_color ()
+RouteTimeAxisView::set_color (Gdk::Color const & c)
 {
-       if (RouteUI::choose_color ()) {
-
-               if (_view) {
-                       _view->apply_color (_color, StreamView::RegionColor);
-               }
+       RouteUI::set_color (c);
+       
+       if (_view) {
+               _view->apply_color (_color, StreamView::RegionColor);
        }
 }
 
index 8515f375b932983ec1d3c2a4052086b6c47d4e16..54d06b4135e574073fe06163ab6a96c85a00b447 100644 (file)
@@ -212,7 +212,7 @@ protected:
        void reset_samples_per_unit ();
        void horizontal_position_changed ();
 
-       void select_track_color();
+       void set_color (Gdk::Color const &);
 
        virtual void build_automation_action_menu ();
        virtual void append_extra_display_menu_items () {}
index b0338ff1216019d4a1626bc32e73999a2396ebf5..209210b8acfd9a281ac6a123304170398da702f9 100644 (file)
@@ -1258,12 +1258,10 @@ RouteUI::toggle_solo_safe (Gtk::CheckMenuItem* check)
 }
 
 bool
-RouteUI::choose_color()
+RouteUI::choose_color ()
 {
        bool picked;
-       Gdk::Color color;
-
-       color = Gtkmm2ext::UI::instance()->get_color (_("Color Selection"), picked, &_color);
+       Gdk::Color const color = Gtkmm2ext::UI::instance()->get_color (_("Color Selection"), picked, &_color);
 
        if (picked) {
                set_color (color);
index ff133642a2d9cee24fbffb5555a5ecf6ff444b6e..c59ace306177318499389d79b2442cceb103f395 100644 (file)
@@ -77,7 +77,7 @@ class RouteUI : public virtual AxisView
 
        boost::shared_ptr<ARDOUR::Route> _route;
 
-       void set_color (const Gdk::Color & c);
+       virtual void set_color (const Gdk::Color & c);
        bool choose_color ();
 
        bool ignore_toggle;