Changeset 96c6a00 in mainline for uspace/lib/ui/src/menu.c


Ignore:
Timestamp:
2022-03-10T13:44:10Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c88d7f99
Parents:
ca2680d
git-author:
Jiri Svoboda <jiri@…> (2022-03-09 18:44:00)
git-committer:
Jiri Svoboda <jiri@…> (2022-03-10 13:44:10)
Message:

Menu accelerators

Open a menu by pressing F10, then accelerator key (e.g. 'F').

File:
1 edited

Legend:

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

    rca2680d r96c6a00  
    4343#include <stdlib.h>
    4444#include <str.h>
     45#include <uchar.h>
     46#include <ui/accel.h>
    4547#include <ui/control.h>
    4648#include <ui/paint.h>
     
    251253        ui_menu_get_geom(menu, spos, &geom);
    252254        *rect = geom.outer_rect;
     255}
     256
     257/** Get menu accelerator character.
     258 *
     259 * @param menu Menu
     260 * @return Accelerator character (lowercase) or the null character if
     261 *         the menu has no accelerator.
     262 */
     263char32_t ui_menu_get_accel(ui_menu_t *menu)
     264{
     265        return ui_accel_get(menu->caption);
    253266}
    254267
Note: See TracChangeset for help on using the changeset viewer.