summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-24 20:07:55 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-24 20:07:55 +0000
commite5dd712ac42c8a8a7367cd6e0b06c530ca990c75 (patch)
treed477502e7a8fae4a0bbb6d59cc73e274028ad710
parente355b5df2726894eb81d1a45ff052022ecd09572 (diff)
Shift-click on a mixer width button toggles width of all
strips (#4510). git-svn-id: svn://localhost/ardour2/branches/3.0@10822 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/mixer_strip.cc45
-rw-r--r--gtk2_ardour/mixer_strip.h2
2 files changed, 35 insertions, 12 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 4442fddb51..ac61ea9d29 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -150,8 +150,13 @@ MixerStrip::init ()
img = manage (new Gtk::Image (::get_icon("strip_width")));
img->show ();
+ string t = _("Click to toggle the width of this mixer strip.");
+ if (_mixer_owned) {
+ t += string_compose (_("\n%1-click to toggle the width of all strips."), Keyboard::tertiary_modifier_name ());
+ }
+
width_button.add (*img);
- ARDOUR_UI::instance()->set_tip (&width_button, _("Toggle the width of this mixer strip"));
+ ARDOUR_UI::instance()->set_tip (width_button, t);
img = manage (new Gtk::Image (::get_icon("hide")));
img->show ();
@@ -278,7 +283,7 @@ MixerStrip::init ()
hide_button.set_name ("MixerHideButton");
top_event_box.set_name ("MixerTopEventBox");
- width_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::width_clicked));
+ width_button.signal_button_press_event().connect (sigc::mem_fun(*this, &MixerStrip::width_button_pressed), false);
hide_button.signal_clicked().connect (sigc::mem_fun(*this, &MixerStrip::hide_clicked));
width_hide_box.pack_start (width_button, false, true);
@@ -1532,17 +1537,35 @@ MixerStrip::name_changed ()
}
}
-void
-MixerStrip::width_clicked ()
+bool
+MixerStrip::width_button_pressed (GdkEventButton* ev)
{
- switch (_width) {
- case Wide:
- set_width_enum (Narrow, this);
- break;
- case Narrow:
- set_width_enum (Wide, this);
- break;
+ if (ev->button != 1) {
+ return false;
}
+
+ if (Keyboard::modifier_state_contains (ev->state, Keyboard::ModifierMask (Keyboard::TertiaryModifier)) && _mixer_owned) {
+ switch (_width) {
+ case Wide:
+ _mixer.set_strip_width (Narrow);
+ break;
+
+ case Narrow:
+ _mixer.set_strip_width (Wide);
+ break;
+ }
+ } else {
+ switch (_width) {
+ case Wide:
+ set_width_enum (Narrow, this);
+ break;
+ case Narrow:
+ set_width_enum (Wide, this);
+ break;
+ }
+ }
+
+ return true;
}
void
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 8e0100ed75..6ef282e697 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -157,7 +157,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::EventBox* spacer;
void hide_clicked();
- void width_clicked ();
+ bool width_button_pressed (GdkEventButton *);
Gtk::Frame global_frame;
Gtk::VBox global_vpacker;