diff options
author | Lionel AINS <lains@caramail.com> | 2018-11-16 18:18:12 +0100 |
---|---|---|
committer | Lionel AINS <lains@caramail.com> | 2018-11-16 18:18:12 +0100 |
commit | 081fa131e879806d30627c242bd4dbf5b558caf6 (patch) | |
tree | 83ad77e1c52ee695725fcb0b01d96ce2b926d538 /navit/gui | |
parent | 7562c5a8f9b404168f7fceeb9ecd202c63586f4f (diff) | |
download | navit-081fa131e879806d30627c242bd4dbf5b558caf6.tar.gz |
Forcing resize when display is resized then the user goes back in submenus
Diffstat (limited to 'navit/gui')
-rw-r--r-- | navit/gui/internal/gui_internal.c | 4 | ||||
-rw-r--r-- | navit/gui/internal/gui_internal_menu.c | 21 |
2 files changed, 15 insertions, 10 deletions
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index abe67af33..31b6e10d2 100644 --- a/navit/gui/internal/gui_internal.c +++ b/navit/gui/internal/gui_internal.c @@ -2723,9 +2723,9 @@ static void gui_internal_resize(void *data, int wnew, int hnew) { dbg(lvl_error, "Will call resize with w=%d, h=%d", wnew, hnew) gui_internal_menu_resize(this, wnew, hnew); gui_internal_menu_render(this); + } else { + dbg(lvl_error,"Current GUI displayed is a menu"); } - } else { - dbg(lvl_error,"Current GUI displayed is a menu"); } } else { gui_internal_menu_render(this); diff --git a/navit/gui/internal/gui_internal_menu.c b/navit/gui/internal/gui_internal_menu.c index 98a2c338e..4e8b434fe 100644 --- a/navit/gui/internal/gui_internal_menu.c +++ b/navit/gui/internal/gui_internal_menu.c @@ -95,7 +95,7 @@ int gui_internal_widget_reload_href(struct gui_priv *this, struct widget *w) { /** * @brief Destroy (discard) all menu screens that have been placed after widget @p w * - * @param this The internal GUI context + * @param this The internal GUI instance * @param w A widget corresponding to the last menu to keep (all subsequent menus in the list will be destroyed). NULL if all menus should be destroyed. * @param render whether we should render the menu indicated by widget w (render!=0) or not (render==0) */ @@ -112,16 +112,21 @@ static void gui_internal_prune_menu_do(struct gui_priv *this, struct widget *w, return; gui_internal_say(this, w, 0); redisplay=w->menu_data->redisplay; - wr=w->menu_data->redisplay_widget; - if (!redisplay && !gui_internal_widget_get_href(w)) { - gui_internal_widget_render(this, w); - return; - } if (redisplay) { + wr=w->menu_data->redisplay_widget; gui_internal_menu_destroy(this, w); redisplay(this, wr, wr->data); - } else { - gui_internal_widget_reload_href(this, w); + } + else { + if (gui_internal_menu_needs_resizing(this, w, this->root.w, this->root.h)) /* Make sure the new menu we are going to display spawns the whole display (in case there was a resize while a submenu was being displayed) */ + if (!gui_internal_widget_reload_href(this, + w)) { /* If the foremost widget is a HTML menu, reload & redraw it from its href */ + /* If not, resize the foremost widget */ + dbg(lvl_error, "Current GUI displayed is not a menu"); + dbg(lvl_error, "Will call resize with w=%d, h=%d", this->root.w, this->root.h) + gui_internal_menu_resize(this, this->root.w, this->root.h); + gui_internal_menu_render(this); + } } return; } |