diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-26 23:35:31 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-26 23:35:31 +0000 |
commit | d1c6e8b6d805b2f74fe12ed42bc1f416ddd48674 (patch) | |
tree | b059fced69d2a2ca7dbd39a4dd9c5f4aea71e900 /gtk2_ardour/route_ui.cc | |
parent | 54ce76e8fd7d6c4840cbdfabd6034bae008f520e (diff) |
if route group shares color, make RouteUI::set_color() affect the group
git-svn-id: svn://localhost/ardour2/branches/3.0@13735 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r-- | gtk2_ardour/route_ui.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 447f359187..9b6e25cbc5 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -1335,18 +1335,26 @@ RouteUI::choose_color () void RouteUI::set_color (const Gdk::Color & c) { - char buf[64]; - - _color = c; + RouteGroup* g = _route->route_group (); - snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue()); + /* leave _color alone in the group case so that tracks can retain their + * own pre-group colors. + */ - /* note: we use the route state ID here so that color is the same for both - the time axis view and the mixer strip - */ - - gui_object_state().set_property<string> (route_state_id(), X_("color"), buf); - _route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */ + if (g && g->is_color()) { + GroupTabs::set_group_color (g, c); + } else { + char buf[64]; + _color = c; + snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue()); + + /* note: we use the route state ID here so that color is the same for both + the time axis view and the mixer strip + */ + + gui_object_state().set_property<string> (route_state_id(), X_("color"), buf); + _route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */ + } } /** @return GUI state ID for things that are common to the route in all its representations */ |