mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
consolidate context-menu popup methods
This commit is contained in:
parent
b3722f7063
commit
3aefd0e744
8 changed files with 17 additions and 57 deletions
|
|
@ -558,16 +558,6 @@ EditorRoutes::build_menu ()
|
|||
items.push_back (MenuElem (_("Only Show Tracks with Regions Under Playhead"), sigc::mem_fun (*this, &EditorRoutes::show_tracks_with_regions_at_playhead)));
|
||||
}
|
||||
|
||||
void
|
||||
EditorRoutes::show_menu ()
|
||||
{
|
||||
if (_menu == 0) {
|
||||
build_menu ();
|
||||
}
|
||||
|
||||
_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
void
|
||||
EditorRoutes::redisplay_real ()
|
||||
{
|
||||
|
|
@ -1472,7 +1462,10 @@ bool
|
|||
EditorRoutes::button_press (GdkEventButton* ev)
|
||||
{
|
||||
if (Keyboard::is_context_menu_event (ev)) {
|
||||
show_menu ();
|
||||
if (_menu == 0) {
|
||||
build_menu ();
|
||||
}
|
||||
_menu->popup (ev->button, ev->time);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ private:
|
|||
void on_tv_solo_isolate_toggled (std::string const &);
|
||||
void on_tv_solo_safe_toggled (std::string const &);
|
||||
void build_menu ();
|
||||
void show_menu ();
|
||||
void presentation_info_changed (PBD::PropertyChange const &);
|
||||
void sync_treeview_from_presentation_info (PBD::PropertyChange const &);
|
||||
void row_deleted (Gtk::TreeModel::Path const &);
|
||||
|
|
|
|||
|
|
@ -562,21 +562,15 @@ MiniTimeline::build_minitl_context_menu ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MiniTimeline::show_minitl_context_menu ()
|
||||
{
|
||||
if (_minitl_context_menu == 0) {
|
||||
build_minitl_context_menu ();
|
||||
}
|
||||
_minitl_context_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
bool
|
||||
MiniTimeline::on_button_press_event (GdkEventButton *ev)
|
||||
{
|
||||
if (Gtkmm2ext::Keyboard::is_context_menu_event (ev)) {
|
||||
if (_session) {
|
||||
show_minitl_context_menu ();
|
||||
if (_minitl_context_menu == 0) {
|
||||
build_minitl_context_menu ();
|
||||
}
|
||||
_minitl_context_menu->popup (ev->button, ev->time);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ private:
|
|||
bool on_leave_notify_event (GdkEventCrossing*);
|
||||
|
||||
void build_minitl_context_menu ();
|
||||
void show_minitl_context_menu ();
|
||||
void set_span (ARDOUR::framecnt_t);
|
||||
|
||||
Glib::RefPtr<Pango::Layout> _layout;
|
||||
|
|
|
|||
|
|
@ -375,6 +375,7 @@ Mixer_UI::~Mixer_UI ()
|
|||
delete _monitor_section;
|
||||
}
|
||||
delete _plugin_selector;
|
||||
delete track_menu;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1549,21 +1550,14 @@ Mixer_UI::initial_track_display ()
|
|||
sync_treeview_from_presentation_info (Properties::order);
|
||||
}
|
||||
|
||||
void
|
||||
Mixer_UI::show_track_list_menu ()
|
||||
{
|
||||
if (track_menu == 0) {
|
||||
build_track_menu ();
|
||||
}
|
||||
|
||||
track_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
bool
|
||||
Mixer_UI::track_display_button_press (GdkEventButton* ev)
|
||||
{
|
||||
if (Keyboard::is_context_menu_event (ev)) {
|
||||
show_track_list_menu ();
|
||||
if (track_menu == 0) {
|
||||
build_track_menu ();
|
||||
}
|
||||
track_menu->popup (ev->button, ev->time);
|
||||
return true;
|
||||
}
|
||||
if ((ev->type == GDK_BUTTON_PRESS) && (ev->button == 1)) {
|
||||
|
|
|
|||
|
|
@ -239,7 +239,6 @@ class Mixer_UI : public Gtkmm2ext::Tabbable, public PBD::ScopedConnectionList, p
|
|||
ARDOUR::PluginPresetPtr selected_plugin ();
|
||||
|
||||
void initial_track_display ();
|
||||
void show_track_list_menu ();
|
||||
|
||||
void set_all_strips_visibility (bool yn);
|
||||
void set_all_audio_midi_visibility (int, bool);
|
||||
|
|
|
|||
|
|
@ -255,16 +255,6 @@ ShuttleControl::build_shuttle_context_menu ()
|
|||
items.push_back (MenuElem (_("Reset to 100%"), sigc::mem_fun (*this, &ShuttleControl::reset_speed)));
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::show_shuttle_context_menu ()
|
||||
{
|
||||
if (shuttle_context_menu == 0) {
|
||||
build_shuttle_context_menu ();
|
||||
}
|
||||
|
||||
shuttle_context_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::reset_speed ()
|
||||
{
|
||||
|
|
@ -295,7 +285,10 @@ ShuttleControl::on_button_press_event (GdkEventButton* ev)
|
|||
}
|
||||
|
||||
if (Keyboard::is_context_menu_event (ev)) {
|
||||
show_shuttle_context_menu ();
|
||||
if (shuttle_context_menu == 0) {
|
||||
build_shuttle_context_menu ();
|
||||
}
|
||||
shuttle_context_menu->popup (ev->button, ev->time);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -667,15 +660,6 @@ ShuttleControl::render (cairo_t* cr, cairo_rectangle_t*)
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::shuttle_unit_clicked ()
|
||||
{
|
||||
if (shuttle_unit_menu == 0) {
|
||||
shuttle_unit_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("/ShuttleUnitPopup"));
|
||||
}
|
||||
shuttle_unit_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::set_shuttle_style (ShuttleBehaviour s)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,9 +82,7 @@ protected:
|
|||
BindingProxy binding_proxy;
|
||||
float bg_r, bg_g, bg_b;
|
||||
void build_shuttle_context_menu ();
|
||||
void show_shuttle_context_menu ();
|
||||
void shuttle_style_changed();
|
||||
void shuttle_unit_clicked ();
|
||||
void set_shuttle_max_speed (float);
|
||||
void reset_speed ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue