Changeset 379cd75f in mainline for uspace/lib/ui/src/fixed.c


Ignore:
Timestamp:
2021-04-01T21:04:11Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Children:
0563982
Parents:
cd62879
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/fixed.c

    rcd62879 r379cd75f  
    4747static errno_t ui_fixed_ctl_paint(void *);
    4848static ui_evclaim_t ui_fixed_ctl_pos_event(void *, pos_event_t *);
     49static void ui_fixed_ctl_unfocus(void *);
    4950
    5051/** Push button control ops */
     
    5253        .destroy = ui_fixed_ctl_destroy,
    5354        .paint = ui_fixed_ctl_paint,
    54         .pos_event = ui_fixed_ctl_pos_event
     55        .pos_event = ui_fixed_ctl_pos_event,
     56        .unfocus = ui_fixed_ctl_unfocus
    5557};
    5658
     
    232234}
    233235
     236/** Handle fixed layout window unfocus notification.
     237 *
     238 * @param fixed Fixed layout
     239 */
     240void ui_fixed_unfocus(ui_fixed_t *fixed)
     241{
     242        ui_fixed_elem_t *elem;
     243
     244        elem = ui_fixed_first(fixed);
     245        while (elem != NULL) {
     246                ui_control_unfocus(elem->control);
     247
     248                elem = ui_fixed_next(elem);
     249        }
     250}
     251
    234252/** Destroy fixed layout control.
    235253 *
     
    268286}
    269287
     288/** Handle fixed layout control window unfocus notification.
     289 *
     290 * @param arg Argument (ui_fixed_t *)
     291 */
     292void ui_fixed_ctl_unfocus(void *arg)
     293{
     294        ui_fixed_t *fixed = (ui_fixed_t *) arg;
     295
     296        ui_fixed_unfocus(fixed);
     297}
     298
    270299/** @}
    271300 */
Note: See TracChangeset for help on using the changeset viewer.