From 9f834e35bbf365bf4e70b133983fe58df27f2244 Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Wed, 1 Apr 2020 13:48:22 +0100 Subject: [PATCH] Welcome: Don't Pop Naviframe. This fixes the annoying "feature" where pressing "Escape" in the EDI wizard will remove all content from the window. --- src/bin/screens/edi_welcome.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/screens/edi_welcome.c b/src/bin/screens/edi_welcome.c index 454f2e4..283f786 100644 --- a/src/bin/screens/edi_welcome.c +++ b/src/bin/screens/edi_welcome.c @@ -899,6 +899,12 @@ _edi_welcome_button_create(const char *title, const char *icon_name, return button; } +static Eina_Bool +_naviframe_pop_stop_nop_cb(void *data EINA_UNUSED, Elm_Object_Item *it EINA_UNUSED) +{ + return EINA_FALSE; +} + Evas_Object *edi_welcome_show() { Evas_Object *win, *hbx, *box, *button, *frame, *image, *naviframe; @@ -918,6 +924,7 @@ Evas_Object *edi_welcome_show() evas_object_show(naviframe); _welcome_naviframe = naviframe; + hbx = elm_box_add(naviframe); elm_box_horizontal_set(hbx, EINA_TRUE); evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -975,6 +982,12 @@ Evas_Object *edi_welcome_show() hbx, NULL); + /* This prevents us losing the content when popping last item from the + * naviframe. + */ + item = elm_naviframe_top_item_get(naviframe); + elm_naviframe_item_pop_cb_set(item, _naviframe_pop_stop_nop_cb, NULL); + elm_naviframe_item_title_enabled_set(item, EINA_FALSE, EINA_FALSE); evas_object_resize(win, ELM_SCALE_SIZE(480), ELM_SCALE_SIZE(260)); elm_win_center(win, EINA_TRUE, EINA_TRUE);