Changeset 46bd63c9 in mainline for uspace/lib/ui/src/menuentry.c


Ignore:
Timestamp:
2023-09-08T08:47:30Z (9 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1af103e
Parents:
0b6fad9
git-author:
Jiri Svoboda <jiri@…> (2023-09-07 18:47:09)
git-committer:
Jiri Svoboda <jiri@…> (2023-09-08 08:47:30)
Message:

Split drop-down menu into two classes: drop-down and menu

Naming is clearly the hardest problem in computer science.

File:
1 edited

Legend:

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

    r0b6fad9 r46bd63c9  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    241241         * This needs to work even if the menu is not open, so we cannot
    242242         * use the menu's resource, which is only created after the menu
    243          * is open (and its window is created). Use the menu bar's
     243         * is open (and its window is created). Use the parent window's
    244244         * resource instead.
    245245         */
    246         res = ui_window_get_res(mentry->menu->mbar->window);
     246        res = ui_window_get_res(mentry->menu->parent);
    247247
    248248        *caption_w = ui_text_width(res->font, mentry->caption);
     
    267267         * This needs to work even if the menu is not open, so we cannot
    268268         * use the menu's resource, which is only created after the menu
    269          * is open (and its window is created). Use the menu bar's
     269         * is open (and its window is created). Use the parent window's
    270270         * resource instead.
    271271         */
    272         res = ui_window_get_res(menu->mbar->window);
     272        res = ui_window_get_res(menu->parent);
    273273
    274274        if (res->textmode)
     
    306306         * This needs to work even if the menu is not open, so we cannot
    307307         * use the menu's resource, which is only created after the menu
    308          * is open (and its window is created). Use the menu bar's
     308         * is open (and its window is created). Use the parent window's
    309309         * resource instead.
    310310         */
    311         res = ui_window_get_res(mentry->menu->mbar->window);
     311        res = ui_window_get_res(mentry->menu->parent);
    312312
    313313        if (res->textmode) {
     
    474474void ui_menu_entry_activate(ui_menu_entry_t *mentry)
    475475{
    476         /* Deactivate menu bar, close menu */
    477         ui_menu_bar_deactivate(mentry->menu->mbar);
     476        /* Close menu */
     477        ui_menu_close_req(mentry->menu);
    478478
    479479        /* Call back */
Note: See TracChangeset for help on using the changeset viewer.