Trap click signals of inline-controls

RouteUI::show_sends_press() is re-used used to show
the send context menu. However other button actions
need to be ignored.
This commit is contained in:
Robin Gareus 2021-03-27 18:47:01 +01:00
parent c91080e950
commit 294b550584
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 12 additions and 1 deletions

View file

@ -500,7 +500,7 @@ FoldbackStrip::init ()
_previous_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::cycle_foldbacks), false)); _previous_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::cycle_foldbacks), false));
_next_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::cycle_foldbacks), true)); _next_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::cycle_foldbacks), true));
_hide_button.signal_clicked.connect (sigc::mem_fun (*this, &FoldbackStrip::hide_clicked)); _hide_button.signal_clicked.connect (sigc::mem_fun (*this, &FoldbackStrip::hide_clicked));
_send_scroller.signal_button_press_event ().connect (sigc::mem_fun (*this, &RouteUI::show_sends_press)); _send_scroller.signal_button_press_event ().connect (sigc::mem_fun (*this, &FoldbackStrip::send_scroller_press));
_comment_button.signal_clicked.connect (sigc::mem_fun (*this, &RouteUI::toggle_comment_editor)); _comment_button.signal_clicked.connect (sigc::mem_fun (*this, &RouteUI::toggle_comment_editor));
add_events (Gdk::BUTTON_RELEASE_MASK | add_events (Gdk::BUTTON_RELEASE_MASK |
@ -821,6 +821,16 @@ FoldbackStrip::name_button_button_press (GdkEventButton* ev)
return false; return false;
} }
bool
FoldbackStrip::send_scroller_press (GdkEventButton* ev)
{
if (Keyboard::is_context_menu_event (ev)) {
/* Show context menu, identical to send button right-click */
return RouteUI::show_sends_press (ev);
}
return true;
}
void void
FoldbackStrip::cycle_foldbacks (bool next) FoldbackStrip::cycle_foldbacks (bool next)
{ {

View file

@ -165,6 +165,7 @@ private:
void update_sensitivity (); void update_sensitivity ();
void spill_change (boost::shared_ptr<ARDOUR::Stripable>); void spill_change (boost::shared_ptr<ARDOUR::Stripable>);
bool name_button_button_press (GdkEventButton*); bool name_button_button_press (GdkEventButton*);
bool send_scroller_press (GdkEventButton*);
void route_property_changed (const PBD::PropertyChange&); void route_property_changed (const PBD::PropertyChange&);
void name_changed (); void name_changed ();
void duplicate_current_fb (); void duplicate_current_fb ();