13
0

Open add-route dialog on double-click or context-click

This commit is contained in:
Robin Gareus 2021-03-28 20:36:37 +02:00
parent e4f59d9a4d
commit 1bffdfc334
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 18 additions and 18 deletions

View File

@ -599,7 +599,8 @@ Editor::Editor ()
controls_layout.set_name ("EditControlsBase");
controls_layout.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|Gdk::SCROLL_MASK);
controls_layout.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::edit_controls_button_release));
controls_layout.signal_button_press_event().connect (sigc::mem_fun(*this, &Editor::edit_controls_button_event));
controls_layout.signal_button_release_event().connect (sigc::mem_fun(*this, &Editor::edit_controls_button_event));
controls_layout.signal_scroll_event().connect (sigc::mem_fun(*this, &Editor::control_layout_scroll), false);
_cursors = new MouseCursors;
@ -3922,14 +3923,13 @@ Editor::override_visible_track_count ()
}
bool
Editor::edit_controls_button_release (GdkEventButton* ev)
Editor::edit_controls_button_event (GdkEventButton* ev)
{
if (Keyboard::is_context_menu_event (ev)) {
if ((ev->type == GDK_2BUTTON_PRESS && ev->button == 1) || (ev->type == GDK_BUTTON_RELEASE && Keyboard::is_context_menu_event (ev))) {
ARDOUR_UI::instance()->add_route ();
} else if (ev->button == 1) {
} else if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS) {
selection->clear_tracks ();
}
return true;
}

View File

@ -1106,7 +1106,7 @@ private:
bool track_canvas_map_handler (GdkEventAny*);
bool edit_controls_button_release (GdkEventButton*);
bool edit_controls_button_event (GdkEventButton*);
Gtk::Menu* edit_controls_left_menu;
Gtk::Menu* edit_controls_right_menu;

View File

@ -151,7 +151,8 @@ Mixer_UI::Mixer_UI ()
scroller_base.set_flags (Gtk::CAN_FOCUS);
scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
scroller_base.set_name ("MixerWindow");
scroller_base.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_release));
scroller_base.signal_button_press_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_event));
scroller_base.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_event));
/* set up drag-n-drop */
vector<TargetEntry> target_table;
@ -296,7 +297,8 @@ Mixer_UI::Mixer_UI ()
vca_hpacker.signal_scroll_event().connect (sigc::mem_fun (*this, &Mixer_UI::on_vca_scroll_event), false);
vca_scroller.add (vca_hpacker);
vca_scroller.set_policy (Gtk::POLICY_ALWAYS, Gtk::POLICY_AUTOMATIC);
vca_scroller.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_release));
vca_scroller.signal_button_press_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_event));
vca_scroller.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_event));
vca_vpacker.pack_start (vca_scroller, true, true);
@ -2393,15 +2395,12 @@ Mixer_UI::add_route_group (RouteGroup* group)
}
bool
Mixer_UI::strip_scroller_button_release (GdkEventButton* ev)
Mixer_UI::strip_scroller_button_event (GdkEventButton* ev)
{
using namespace Menu_Helpers;
if (Keyboard::is_context_menu_event (ev)) {
if ((ev->type == GDK_2BUTTON_PRESS && ev->button == 1) || (ev->type == GDK_BUTTON_RELEASE && Keyboard::is_context_menu_event (ev))) {
ARDOUR_UI::instance()->add_route ();
return true;
}
return false;
}

View File

@ -211,7 +211,7 @@ private:
std::list<MixerStrip *> strips;
void scroller_drag_data_received (const Glib::RefPtr<Gdk::DragContext>&, int, int, const Gtk::SelectionData&, guint, guint);
bool strip_scroller_button_release (GdkEventButton*);
bool strip_scroller_button_event (GdkEventButton*);
bool masters_scroller_button_release (GdkEventButton*);
void scroll_left ();
void scroll_right ();

View File

@ -145,7 +145,8 @@ RecorderUI::RecorderUI ()
_scroller_base.set_flags (CAN_FOCUS);
_scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
_scroller_base.signal_button_release_event().connect (sigc::mem_fun(*this, &RecorderUI::scroller_button_release));
_scroller_base.signal_button_press_event().connect (sigc::mem_fun(*this, &RecorderUI::scroller_button_event));
_scroller_base.signal_button_release_event().connect (sigc::mem_fun(*this, &RecorderUI::scroller_button_event));
_scroller_base.set_size_request (-1, PX_SCALE (20));
_scroller_base.signal_expose_event().connect (sigc::bind (sigc::ptr_fun(&ArdourWidgets::ArdourIcon::expose), &_scroller_base, ArdourWidgets::ArdourIcon::ShadedPlusSign));
@ -504,9 +505,9 @@ RecorderUI::parameter_changed (string const& p)
}
bool
RecorderUI::scroller_button_release (GdkEventButton* ev)
RecorderUI::scroller_button_event (GdkEventButton* ev)
{
if (Keyboard::is_context_menu_event (ev)) {
if ((ev->type == GDK_2BUTTON_PRESS && ev->button == 1) || (ev->type == GDK_BUTTON_RELEASE && Keyboard::is_context_menu_event (ev))) {
ARDOUR_UI::instance()->add_route ();
return true;
}

View File

@ -103,7 +103,7 @@ private:
void meter_area_size_request (GtkRequisition*);
void meter_area_layout ();
bool scroller_button_release (GdkEventButton*);
bool scroller_button_event (GdkEventButton*);
void arm_all ();
void arm_none ();