mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +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)));
|
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
|
void
|
||||||
EditorRoutes::redisplay_real ()
|
EditorRoutes::redisplay_real ()
|
||||||
{
|
{
|
||||||
|
|
@ -1472,7 +1462,10 @@ bool
|
||||||
EditorRoutes::button_press (GdkEventButton* ev)
|
EditorRoutes::button_press (GdkEventButton* ev)
|
||||||
{
|
{
|
||||||
if (Keyboard::is_context_menu_event (ev)) {
|
if (Keyboard::is_context_menu_event (ev)) {
|
||||||
show_menu ();
|
if (_menu == 0) {
|
||||||
|
build_menu ();
|
||||||
|
}
|
||||||
|
_menu->popup (ev->button, ev->time);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ private:
|
||||||
void on_tv_solo_isolate_toggled (std::string const &);
|
void on_tv_solo_isolate_toggled (std::string const &);
|
||||||
void on_tv_solo_safe_toggled (std::string const &);
|
void on_tv_solo_safe_toggled (std::string const &);
|
||||||
void build_menu ();
|
void build_menu ();
|
||||||
void show_menu ();
|
|
||||||
void presentation_info_changed (PBD::PropertyChange const &);
|
void presentation_info_changed (PBD::PropertyChange const &);
|
||||||
void sync_treeview_from_presentation_info (PBD::PropertyChange const &);
|
void sync_treeview_from_presentation_info (PBD::PropertyChange const &);
|
||||||
void row_deleted (Gtk::TreeModel::Path 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
|
bool
|
||||||
MiniTimeline::on_button_press_event (GdkEventButton *ev)
|
MiniTimeline::on_button_press_event (GdkEventButton *ev)
|
||||||
{
|
{
|
||||||
if (Gtkmm2ext::Keyboard::is_context_menu_event (ev)) {
|
if (Gtkmm2ext::Keyboard::is_context_menu_event (ev)) {
|
||||||
if (_session) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ private:
|
||||||
bool on_leave_notify_event (GdkEventCrossing*);
|
bool on_leave_notify_event (GdkEventCrossing*);
|
||||||
|
|
||||||
void build_minitl_context_menu ();
|
void build_minitl_context_menu ();
|
||||||
void show_minitl_context_menu ();
|
|
||||||
void set_span (ARDOUR::framecnt_t);
|
void set_span (ARDOUR::framecnt_t);
|
||||||
|
|
||||||
Glib::RefPtr<Pango::Layout> _layout;
|
Glib::RefPtr<Pango::Layout> _layout;
|
||||||
|
|
|
||||||
|
|
@ -375,6 +375,7 @@ Mixer_UI::~Mixer_UI ()
|
||||||
delete _monitor_section;
|
delete _monitor_section;
|
||||||
}
|
}
|
||||||
delete _plugin_selector;
|
delete _plugin_selector;
|
||||||
|
delete track_menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1549,21 +1550,14 @@ Mixer_UI::initial_track_display ()
|
||||||
sync_treeview_from_presentation_info (Properties::order);
|
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
|
bool
|
||||||
Mixer_UI::track_display_button_press (GdkEventButton* ev)
|
Mixer_UI::track_display_button_press (GdkEventButton* ev)
|
||||||
{
|
{
|
||||||
if (Keyboard::is_context_menu_event (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;
|
return true;
|
||||||
}
|
}
|
||||||
if ((ev->type == GDK_BUTTON_PRESS) && (ev->button == 1)) {
|
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 ();
|
ARDOUR::PluginPresetPtr selected_plugin ();
|
||||||
|
|
||||||
void initial_track_display ();
|
void initial_track_display ();
|
||||||
void show_track_list_menu ();
|
|
||||||
|
|
||||||
void set_all_strips_visibility (bool yn);
|
void set_all_strips_visibility (bool yn);
|
||||||
void set_all_audio_midi_visibility (int, bool);
|
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)));
|
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
|
void
|
||||||
ShuttleControl::reset_speed ()
|
ShuttleControl::reset_speed ()
|
||||||
{
|
{
|
||||||
|
|
@ -295,7 +285,10 @@ ShuttleControl::on_button_press_event (GdkEventButton* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Keyboard::is_context_menu_event (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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -667,15 +660,6 @@ ShuttleControl::render (cairo_t* cr, cairo_rectangle_t*)
|
||||||
#endif
|
#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
|
void
|
||||||
ShuttleControl::set_shuttle_style (ShuttleBehaviour s)
|
ShuttleControl::set_shuttle_style (ShuttleBehaviour s)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,7 @@ protected:
|
||||||
BindingProxy binding_proxy;
|
BindingProxy binding_proxy;
|
||||||
float bg_r, bg_g, bg_b;
|
float bg_r, bg_g, bg_b;
|
||||||
void build_shuttle_context_menu ();
|
void build_shuttle_context_menu ();
|
||||||
void show_shuttle_context_menu ();
|
|
||||||
void shuttle_style_changed();
|
void shuttle_style_changed();
|
||||||
void shuttle_unit_clicked ();
|
|
||||||
void set_shuttle_max_speed (float);
|
void set_shuttle_max_speed (float);
|
||||||
void reset_speed ();
|
void reset_speed ();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue