Changeset 112f70a in mainline for uspace/lib/ui/src/menu.c


Ignore:
Timestamp:
2023-09-14T09:53:27Z (13 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8a6ebbb
Parents:
61643c8
git-author:
Jiri Svoboda <jiri@…> (2023-09-13 18:53:09)
git-committer:
Jiri Svoboda <jiri@…> (2023-09-14 09:53:27)
Message:

Allow menu entries to be disabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/menu.c

    r61643c8 r112f70a  
    534534                break;
    535535        case KC_ENTER:
    536                 if (menu->selected != NULL)
     536                if (menu->selected != NULL &&
     537                    !ui_menu_entry_is_disabled(menu->selected))
    537538                        ui_menu_entry_activate(menu->selected);
    538539                break;
     
    543544                                c = ui_menu_entry_get_accel(mentry);
    544545                                if (c == (char32_t)tolower(event->c) &&
    545                                     menu->selected != NULL) {
     546                                    !ui_menu_entry_is_disabled(mentry)) {
    546547                                        ui_menu_entry_activate(mentry);
    547548                                        break;
Note: See TracChangeset for help on using the changeset viewer.