mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 13:37:02 +03:00
Call close function for submenu windows.
svn path=/trunk/netsurf/; revision=3226
This commit is contained in:
parent
e5129294c0
commit
933c642019
@ -574,10 +574,7 @@ void ro_gui_menu_closed(bool cleanup) {
|
|||||||
current_menu = NULL;
|
current_menu = NULL;
|
||||||
|
|
||||||
if (cleanup) {
|
if (cleanup) {
|
||||||
/* end any search operation that was started so that
|
ro_gui_wimp_event_menus_closed();
|
||||||
the text doesn't remain highlighted */
|
|
||||||
if (ro_gui_menu_search_window_menu)
|
|
||||||
ro_gui_search_end(dialog_search);
|
|
||||||
|
|
||||||
if (tree)
|
if (tree)
|
||||||
ro_gui_tree_menu_closed(tree);
|
ro_gui_tree_menu_closed(tree);
|
||||||
@ -726,6 +723,7 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning) {
|
|||||||
entries[warning->selection.items[i]];
|
entries[warning->selection.items[i]];
|
||||||
|
|
||||||
if (IS_MENU(menu_entry->sub_menu)) {
|
if (IS_MENU(menu_entry->sub_menu)) {
|
||||||
|
ro_gui_wimp_event_register_submenu((wimp_w)0);
|
||||||
sub_menu = menu_entry->sub_menu;
|
sub_menu = menu_entry->sub_menu;
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
@ -736,6 +734,7 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning) {
|
|||||||
action, false);
|
action, false);
|
||||||
} while (!(sub_menu->entries[i++].menu_flags & wimp_MENU_LAST));
|
} while (!(sub_menu->entries[i++].menu_flags & wimp_MENU_LAST));
|
||||||
} else {
|
} else {
|
||||||
|
ro_gui_wimp_event_register_submenu((wimp_w)menu_entry->sub_menu);
|
||||||
action = ro_gui_menu_find_action(current_menu, menu_entry);
|
action = ro_gui_menu_find_action(current_menu, menu_entry);
|
||||||
if (action != NO_ACTION)
|
if (action != NO_ACTION)
|
||||||
ro_gui_menu_prepare_action(current_menu_window,
|
ro_gui_menu_prepare_action(current_menu_window,
|
||||||
|
@ -100,6 +100,7 @@ static struct event_window *ro_gui_wimp_event_remove_window(wimp_w w);
|
|||||||
|
|
||||||
static struct event_window *ro_gui_wimp_event_windows[WIN_HASH_SIZE];
|
static struct event_window *ro_gui_wimp_event_windows[WIN_HASH_SIZE];
|
||||||
|
|
||||||
|
static wimp_w ro_gui_wimp_event_submenu;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Memorises the current state of any registered components in a window.
|
* Memorises the current state of any registered components in a window.
|
||||||
@ -856,6 +857,8 @@ bool ro_gui_wimp_event_close_window(wimp_w w) {
|
|||||||
struct event_window *window;
|
struct event_window *window;
|
||||||
|
|
||||||
LOG(("Close event received for window 0x%x", (unsigned int)w));
|
LOG(("Close event received for window 0x%x", (unsigned int)w));
|
||||||
|
if (w == ro_gui_wimp_event_submenu)
|
||||||
|
ro_gui_wimp_event_submenu = 0;
|
||||||
window = ro_gui_wimp_event_find_window(w);
|
window = ro_gui_wimp_event_find_window(w);
|
||||||
if ((window) && (window->close_window)) {
|
if ((window) && (window->close_window)) {
|
||||||
window->close_window(w);
|
window->close_window(w);
|
||||||
@ -1216,3 +1219,19 @@ struct icon_event *ro_gui_wimp_event_get_event(wimp_w w, wimp_i i, event_type ty
|
|||||||
|
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle menus being closed
|
||||||
|
*/
|
||||||
|
void ro_gui_wimp_event_menus_closed(void) {
|
||||||
|
ro_gui_wimp_event_register_submenu(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a submenu as being opened
|
||||||
|
*/
|
||||||
|
void ro_gui_wimp_event_register_submenu(wimp_w w) {
|
||||||
|
if (ro_gui_wimp_event_submenu)
|
||||||
|
ro_gui_wimp_event_close_window(ro_gui_wimp_event_submenu);
|
||||||
|
ro_gui_wimp_event_submenu = w;
|
||||||
|
}
|
||||||
|
@ -68,4 +68,7 @@ bool ro_gui_wimp_event_register_redraw_window(wimp_w w,
|
|||||||
bool ro_gui_wimp_event_register_menu_selection(wimp_w w,
|
bool ro_gui_wimp_event_register_menu_selection(wimp_w w,
|
||||||
void (*callback)(wimp_w w, wimp_i i));
|
void (*callback)(wimp_w w, wimp_i i));
|
||||||
|
|
||||||
|
void ro_gui_wimp_event_menus_closed(void);
|
||||||
|
void ro_gui_wimp_event_register_submenu(wimp_w w);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user