Changeset 966a27d3 in mainline for uspace/app/nav/nav.c


Ignore:
Timestamp:
2021-10-22T07:45:13Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Children:
8922b76
Parents:
2651dc5
git-author:
Jiri Svoboda <jiri@…> (2021-10-21 17:44:55)
git-committer:
Jiri Svoboda <jiri@…> (2021-10-22 07:45:13)
Message:

Activating panel using the mouse

File:
1 edited

Legend:

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

    r2651dc5 r966a27d3  
    6363};
    6464
     65static void navigator_panel_activate_req(void *, panel_t *);
     66
     67static panel_cb_t navigator_panel_cb = {
     68        .activate_req = navigator_panel_activate_req
     69};
     70
    6571/** Window close button was clicked.
    6672 *
     
    183189                panel_set_rect(navigator->panel[i], &rect);
    184190
     191                panel_set_cb(navigator->panel[i], &navigator_panel_cb,
     192                    navigator);
     193
    185194                rc = ui_fixed_add(navigator->fixed,
    186195                    panel_ctl(navigator->panel[i]));
     
    307316}
    308317
     318/** Panel callback requesting panel activation.
     319 *
     320 * @param arg Argument (navigator_t *)
     321 * @param panel Panel
     322 */
     323void navigator_panel_activate_req(void *arg, panel_t *panel)
     324{
     325        navigator_t *navigator = (navigator_t *)arg;
     326
     327        if (!panel_is_active(panel))
     328                navigator_switch_panel(navigator);
     329}
     330
    309331/** @}
    310332 */
Note: See TracChangeset for help on using the changeset viewer.