</menu>
</menubar>
- <popup action="RulerMenuPopup">
+ <popup action="editorTabbableButtonMenu">
+ <menuitem action='show-editor'/>
+ <menuitem action='hide-editor'/>
+ <menuitem action='attach-editor'/>
+ <menuitem action='detach-editor'/>
+ </popup>
+
+ <popup action="mixerTabbableButtonMenu">
+ <menuitem action='show-mixer'/>
+ <menuitem action='hide-mixer'/>
+ <menuitem action='attach-mixer'/>
+ <menuitem action='detach-mixer'/>
+ </popup>
+
+ <popup action="prefsTabbableButtonMenu">
+ <menuitem action='show-preferences'/>
+ <menuitem action='hide-preferences'/>
+ <menuitem action='attach-preferences'/>
+ <menuitem action='detach-preferences'/>
+ </popup>
+
+<popup action="RulerMenuPopup">
<menuitem action="toggle-minsec-ruler"/>
<menuitem action="toggle-timecode-ruler"/>
<menuitem action="toggle-samples-ruler"/>
bool idle_ask_about_quit ();
void load_bindings ();
+ bool tabbable_visibility_button_press (GdkEventButton* ev, std::string const& tabbable_name);
};
#endif /* __ardour_gui_h__ */
mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
+ /* catch context clicks so that we can show a menu on these buttons */
+
+ editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
+ mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
+ prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
editor_visibility_button.set_name (X_("page switch button"));
{
return _tabs;
}
+
+bool
+ARDOUR_UI::tabbable_visibility_button_press (GdkEventButton* ev, string const& tabbable_name)
+{
+ if (ev->button != 3) {
+ return false;
+ }
+
+ /* context menu is defined in *.menus.in
+ */
+
+ string menu_name = string ("/ui/") + tabbable_name + X_("TabbableButtonMenu");
+ Gtk::Menu* menu = dynamic_cast<Gtk::Menu*> (ActionManager::get_widget (menu_name.c_str()));
+ if (menu) {
+ menu->popup (3, ev->time);
+ }
+ return true;
+}