mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Make track context colour menu apply to all selected tracks.
git-svn-id: svn://localhost/ardour2/branches/3.0@8934 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1b8a919f57
commit
f9e3a8b59f
4 changed files with 18 additions and 6 deletions
|
|
@ -441,7 +441,7 @@ RouteTimeAxisView::build_display_menu ()
|
||||||
MenuList& items = display_menu->items();
|
MenuList& items = display_menu->items();
|
||||||
display_menu->set_name ("ArdourContextMenu");
|
display_menu->set_name ("ArdourContextMenu");
|
||||||
|
|
||||||
items.push_back (MenuElem (_("Color..."), sigc::hide_return (sigc::mem_fun (*this, &RouteUI::choose_color))));
|
items.push_back (MenuElem (_("Color..."), sigc::mem_fun (*this, &RouteUI::choose_color)));
|
||||||
|
|
||||||
build_size_menu ();
|
build_size_menu ();
|
||||||
items.push_back (MenuElem (_("Height"), *_size_menu));
|
items.push_back (MenuElem (_("Height"), *_size_menu));
|
||||||
|
|
|
||||||
|
|
@ -1257,17 +1257,20 @@ RouteUI::toggle_solo_safe (Gtk::CheckMenuItem* check)
|
||||||
_route->set_solo_safe (check->get_active(), this);
|
_route->set_solo_safe (check->get_active(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
/** Ask the user to choose a colour, and then set all selected tracks
|
||||||
|
* to that colour.
|
||||||
|
*/
|
||||||
|
void
|
||||||
RouteUI::choose_color ()
|
RouteUI::choose_color ()
|
||||||
{
|
{
|
||||||
bool picked;
|
bool picked;
|
||||||
Gdk::Color const 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) {
|
if (picked) {
|
||||||
set_color (color);
|
ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (
|
||||||
|
boost::bind (&RouteUI::set_color, _1, color)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return picked;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ class RouteUI : public virtual AxisView
|
||||||
boost::shared_ptr<ARDOUR::Route> _route;
|
boost::shared_ptr<ARDOUR::Route> _route;
|
||||||
|
|
||||||
virtual void set_color (const Gdk::Color & c);
|
virtual void set_color (const Gdk::Color & c);
|
||||||
bool choose_color ();
|
void choose_color ();
|
||||||
|
|
||||||
bool ignore_toggle;
|
bool ignore_toggle;
|
||||||
bool wait_for_release;
|
bool wait_for_release;
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#define __ardour_gtk_track_selection_h__
|
#define __ardour_gtk_track_selection_h__
|
||||||
|
|
||||||
#include "track_view_list.h"
|
#include "track_view_list.h"
|
||||||
|
#include "route_ui.h"
|
||||||
|
|
||||||
class PublicEditor;
|
class PublicEditor;
|
||||||
|
|
||||||
|
|
@ -34,6 +35,14 @@ public:
|
||||||
|
|
||||||
TrackViewList add (TrackViewList const &);
|
TrackViewList add (TrackViewList const &);
|
||||||
|
|
||||||
|
template <typename Function>
|
||||||
|
void foreach_route_ui (Function f) {
|
||||||
|
for (iterator i = begin(); i != end(); ++i) {
|
||||||
|
RouteUI* t = dynamic_cast<RouteUI*> (*i);
|
||||||
|
f (t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PublicEditor const * _editor;
|
PublicEditor const * _editor;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue