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

Changeset 2e1dbf7d in mainline


Ignore:
Timestamp:
2021-04-01T22:31:15Z (10 months ago)
Author:
Jiri Svoboda <jiri@…>
Children:
e7b32d7
Parents:
0563982
Message:

Close menu when button is pressed outside of it

File:
1 edited

Legend:

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

    r0563982 r2e1dbf7d  
    273273}
    274274
    275 /** Handle button press in menu.
     275/** Handle position event in menu.
    276276 *
    277277 * @param menu Menu
     
    305305        }
    306306
    307         if (gfx_pix_inside_rect(&epos, &geom.outer_rect))
     307        /* Event inside menu? */
     308        if (gfx_pix_inside_rect(&epos, &geom.outer_rect)) {
     309                /* Claim event */
    308310                return ui_claimed;
     311        } else {
     312                /* Press outside menu - close it */
     313                if (event->type == POS_PRESS)
     314                        ui_menu_bar_select(menu->mbar, NULL, NULL);
     315        }
    309316
    310317        return ui_unclaimed;
Note: See TracChangeset for help on using the changeset viewer.