Fix #80307: Underline shortcut not working in enum context menus

The buttons of enum context menus are of type `UI_BUT_ROW`. They
are part of the set of buttons we create underline shortcuts for in
`ui_menu_block_set_keyaccels`.
But since they weren't handled in `ui_handle_button_activate_by_type`,
pressing the underline shortcuts didn't do anyting in those cases.

Co-authored-by: Leon Schittek <leon.schittek@gmx.net>
Co-authored-by: Brecht Van Lommel <brecht@noreply.localhost>
Pull Request #104433
This commit is contained in:
2023-02-13 10:43:36 +01:00
parent 2e19aa1399
commit 9f4ee75c9b

View File

@@ -9039,7 +9039,7 @@ static void ui_handle_button_activate(bContext *C,
*/
static bool ui_handle_button_activate_by_type(bContext *C, ARegion *region, uiBut *but)
{
if (but->type == UI_BTYPE_BUT_MENU) {
if (ELEM(but->type, UI_BTYPE_BUT_MENU, UI_BTYPE_ROW)) {
/* mainly for operator buttons */
ui_handle_button_activate(C, region, but, BUTTON_ACTIVATE_APPLY);
}