Changeset 4055fe63 in mainline for uspace/lib/ui/src/popup.c


Ignore:
Timestamp:
2021-06-04T20:02:36Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Children:
4b72e81
Parents:
2e6394e
Message:

Deliver close event to popup window when appropriate

That is, when focus changes or when user clicks outside of the
popup window.

File:
1 edited

Legend:

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

    r2e6394e r4055fe63  
    4646#include "../private/popup.h"
    4747
     48static void ui_popup_window_close(ui_window_t *, void *);
    4849static void ui_popup_window_pos(ui_window_t *, void *, pos_event_t *);
    4950
    5051static ui_window_cb_t ui_popup_window_cb = {
     52        .close = ui_popup_window_close,
    5153        .pos = ui_popup_window_pos
    5254};
     
    185187}
    186188
     189/** Handle close event in popup window.
     190 *
     191 * @param window Window
     192 * @param arg Argument (ui_popup_t *)
     193 */
     194static void ui_popup_window_close(ui_window_t *window, void *arg)
     195{
     196        ui_popup_t *popup = (ui_popup_t *)arg;
     197
     198        if (popup->cb != NULL && popup->cb->close != NULL)
     199                popup->cb->close(popup, popup->arg);
     200}
     201
    187202/** Handle position event in popup window.
    188203 *
Note: See TracChangeset for help on using the changeset viewer.