From 87993d76ba2adfc43dbdfaf5f9a143b01641c622 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Sat, 10 Aug 2013 18:52:35 +0900 Subject: [PATCH] elementary/popup - Fix the corrupted internal widget tree that caused elm_theme_set() doesn't work correctly. --- legacy/elementary/ChangeLog | 7 ++++++- legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elc_popup.c | 21 ++++++++++++++------- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 00d6f9a357..6f094fae1d 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1536,4 +1536,9 @@ 2013-08-09 Cedric Bail - * Add support for URL in Elm_Image. + * Add support for URL in Elm_Image. + +2013-08-10 ChunEon Park (Hermet) + + * Popup: Fix the corrupted internal widget tree that caused + elm_theme_set() doesn't work correctly. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index d639c3c462..9d839c3228 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -279,6 +279,7 @@ Removals: * Deprecate elm_web_uri_set(), elm_web_uri_get() and "uri,changed" signal for web, web2. * Naviframe: Dont' be popped if the event is freezed and popping is going on. * Ctxpopup: Apply current ctxpopup style to the list. + * Popup: Fix the corrupted internal widget tree that caused elm_theme_set() doesn't work correctly. Changes since Elementary 1.0.0: ------------------------- diff --git a/legacy/elementary/src/lib/elc_popup.c b/legacy/elementary/src/lib/elc_popup.c index 6ee5c275d2..f2615cef80 100644 --- a/legacy/elementary/src/lib/elc_popup.c +++ b/legacy/elementary/src/lib/elc_popup.c @@ -100,12 +100,17 @@ _on_show(void *data __UNUSED__, { ELM_POPUP_DATA_GET(obj, sd); - evas_object_show(sd->notify); + /* yeah, ugly, but again, this widget needs a rewrite */ + if (elm_widget_parent_get(sd->notify) == obj) + elm_widget_sub_object_del(obj, sd->notify); /* FIXME: Should be rewritten popup. This code is for arranging child-parent relation well. Without this code, Popup't top parent will be notify. And there will be no parent for notify. Terrible! */ elm_widget_sub_object_add(elm_widget_parent_get(obj), sd->notify); + elm_object_content_set(sd->notify, obj); + evas_object_show(sd->notify); + elm_object_focus_set(obj, EINA_TRUE); } @@ -117,9 +122,12 @@ _on_hide(void *data __UNUSED__, { ELM_POPUP_DATA_GET(obj, sd); - evas_object_hide(sd->notify); - + //Revert the obj-tree again. elm_object_content_unset(sd->notify); + elm_widget_sub_object_add(elm_widget_parent_get(sd->notify), obj); + elm_widget_sub_object_add(obj, sd->notify); + + evas_object_hide(sd->notify); /* FIXME:elm_object_content_unset(notify) deletes callback to revert focus status. */ elm_object_focus_set(obj, EINA_FALSE); @@ -325,10 +333,9 @@ _elm_popup_smart_theme(Eo *obj, void *_pd, va_list *list) _mirrored_set(obj, elm_widget_mirrored_get(obj)); - /* Since parent of the popup can be notify, we need to set the notify style - manually. */ - if (elm_widget_parent_get(sd->notify) != obj) - eo_do(sd->notify, elm_wdg_style_set(elm_widget_style_get(obj), &ret)); + //FIXME: theme set seems corrupted. + //if (elm_widget_parent_get(sd->notify) != obj) + elm_widget_style_set(sd->notify, elm_widget_style_get(obj)); if (sd->action_area) {