Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 62223ec in mainline for uspace/lib/ui/src/menubar.c


Ignore:
Timestamp:
2021-04-09T22:41:22Z (8 months ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
master
Children:
f251883
Parents:
0262f16c
git-author:
Jiri Svoboda <jiri@…> (2021-04-01 21:04:11)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2021-04-09 22:41:22)
Message:

Close menu when window is unfocused

This of course means we need to do all the plumbing for delivering
unfocus event to UI controls.

File:
1 edited

Legend:

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

    r0262f16c r62223ec  
    6060static errno_t ui_menu_bar_ctl_paint(void *);
    6161static ui_evclaim_t ui_menu_bar_ctl_pos_event(void *, pos_event_t *);
     62static void ui_menu_bar_ctl_unfocus(void *);
    6263
    6364/** Menu bar control ops */
     
    6566        .destroy = ui_menu_bar_ctl_destroy,
    6667        .paint = ui_menu_bar_ctl_paint,
    67         .pos_event = ui_menu_bar_ctl_pos_event
     68        .pos_event = ui_menu_bar_ctl_pos_event,
     69        .unfocus = ui_menu_bar_ctl_unfocus
    6870};
    6971
     
    328330}
    329331
     332/** Handle menu bar window unfocus notification.
     333 *
     334 * @param mbar Menu bar
     335 */
     336void ui_menu_bar_unfocus(ui_menu_bar_t *mbar)
     337{
     338        ui_menu_bar_select(mbar, NULL, NULL);
     339}
     340
    330341/** Destroy menu bar control.
    331342 *
     
    364375}
    365376
     377/** Handle menu bar control window unfocus notification.
     378 *
     379 * @param arg Argument (ui_menu_bar_t *)
     380 */
     381void ui_menu_bar_ctl_unfocus(void *arg)
     382{
     383        ui_menu_bar_t *mbar = (ui_menu_bar_t *) arg;
     384
     385        ui_menu_bar_unfocus(mbar);
     386}
     387
    366388/** @}
    367389 */
Note: See TracChangeset for help on using the changeset viewer.