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


Ignore:
Timestamp:
2021-05-26T07:40:59Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Children:
6baab83
Parents:
344f8b9
git-author:
Jiri Svoboda <jiri@…> (2021-05-25 18:40:50)
git-committer:
Jiri Svoboda <jiri@…> (2021-05-26 07:40:59)
Message:

Specify parent window when creating popup

This will be used in conjunction with ui_wnd_popup_params_t.place
(a rectangle relative to the parent window) to determine where on
the screen the popup window should appear.

File:
1 edited

Legend:

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

    r344f8b9 rf2416ec3  
    4949#include <ui/menuentry.h>
    5050#include <ui/resource.h>
     51#include <ui/window.h>
    5152#include "../private/menubar.h"
    5253#include "../private/menu.h"
     
    170171    ui_menu_geom_t *geom)
    171172{
     173        ui_resource_t *res;
    172174        gfx_coord2_t edim;
    173175        gfx_coord_t frame_w;
    174176        gfx_coord_t frame_h;
    175177
    176         if (menu->mbar->res->textmode) {
     178        res = ui_window_get_res(menu->mbar->window);
     179
     180        if (res->textmode) {
    177181                frame_w = menu_frame_w_text;
    178182                frame_h = menu_frame_h_text;
     
    242246        params.rect = geom.outer_rect;
    243247
    244         rc = ui_popup_create(menu->mbar->ui, &params, &popup);
     248        rc = ui_popup_create(menu->mbar->ui, menu->mbar->window, &params,
     249            &popup);
    245250        if (rc != EOK)
    246251                return rc;
Note: See TracChangeset for help on using the changeset viewer.