Changeset 8edec53 in mainline for uspace/app/nav/nav.c


Ignore:
Timestamp:
2021-10-25T17:51:10Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
91ece11b
Parents:
805a149
Message:

Support double-click

Needed to open Navigator entries using the mouse.

File:
1 edited

Legend:

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

    r805a149 r8edec53  
    130130        ui_wnd_params_t params;
    131131        gfx_rect_t rect;
     132        gfx_rect_t arect;
     133        gfx_coord_t pw;
    132134        unsigned i;
    133135        errno_t rc;
     
    155157
    156158        ui_window_set_cb(navigator->window, &window_cb, (void *) navigator);
     159        ui_window_get_app_rect(navigator->window, &arect);
    157160
    158161        rc = ui_fixed_create(&navigator->fixed);
     
    176179                return rc;
    177180        }
     181
     182        /* Panel width */
     183        pw = (arect.p1.x - arect.p0.x) / 2;
    178184
    179185        for (i = 0; i < 2; i++) {
     
    183189                        goto error;
    184190
    185                 rect.p0.x = 40 * i;
    186                 rect.p0.y = 1;
    187                 rect.p1.x = 40 * (i + 1);
    188                 rect.p1.y = 24;
     191                rect.p0.x = arect.p0.x + pw * i;
     192                rect.p0.y = arect.p0.y + 1;
     193                rect.p1.x = arect.p0.x + pw * (i + 1);
     194                rect.p1.y = arect.p1.y - 1;
    189195                panel_set_rect(navigator->panel[i], &rect);
    190196
Note: See TracChangeset for help on using the changeset viewer.