Changeset 7cf5ddb in mainline for uspace/app/nav/panel.c


Ignore:
Timestamp:
2023-03-08T18:21:22Z (21 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
42c2e65, 72ac106
Parents:
bea6233
Message:

Generic UI list control

Derived from file list, now file list is based on UI list.
Whew!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nav/panel.c

    rbea6233 r7cf5ddb  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    6060};
    6161
     62static void panel_flist_activate_req(ui_file_list_t *, void *);
    6263static void panel_flist_selected(ui_file_list_t *, void *, const char *);
    6364
    6465/** Panel file list callbacks */
    6566static ui_file_list_cb_t panel_flist_cb = {
    66         .selected = panel_flist_selected
     67        .activate_req = panel_flist_activate_req,
     68        .selected = panel_flist_selected,
    6769};
    6870
     
    216218        gfx_coord2_t pos;
    217219        ui_control_t *ctl;
     220        ui_evclaim_t claim;
    218221
    219222        pos.x = event->hpos;
     
    222225                return ui_unclaimed;
    223226
     227        ctl = ui_file_list_ctl(panel->flist);
     228        claim = ui_control_pos_event(ctl, event);
     229        if (claim == ui_claimed)
     230                return ui_claimed;
     231
    224232        if (!panel->active && event->type == POS_PRESS)
    225233                panel_activate_req(panel);
    226234
    227         ctl = ui_file_list_ctl(panel->flist);
    228         return ui_control_pos_event(ctl, event);
     235        return ui_claimed;
    229236}
    230237
     
    416423}
    417424
     425/** File list in panel requests activation.
     426 *
     427 * @param flist File list
     428 * @param arg Argument (panel_t *)
     429 */
     430static void panel_flist_activate_req(ui_file_list_t *flist, void *arg)
     431{
     432        panel_t *panel = (panel_t *)arg;
     433
     434        panel_activate_req(panel);
     435}
     436
    418437/** File in panel file list was selected.
    419438 *
Note: See TracChangeset for help on using the changeset viewer.