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));
_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));
_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));
add_events (Gdk::BUTTON_RELEASE_MASK |
@ -821,6 +821,16 @@ FoldbackStrip::name_button_button_press (GdkEventButton* ev)
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
FoldbackStrip::cycle_foldbacks (bool next)
{