rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=a8ee27cdd9d9e5afa3e46513f197e426c0e5bb36

commit a8ee27cdd9d9e5afa3e46513f197e426c0e5bb36
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Oct 13 09:47:05 2015 +0300

    popup: separate the popup and helper
    
    This need do, because popup and helper can be shown together on
    window.
    
    Change-Id: I5d0b69a9cb60bbe9e9c21b1b16e940e6ff51868b
---
 src/bin/ui/popup.c | 77 +++++++++++++++++++++++++++---------------------------
 1 file changed, 39 insertions(+), 38 deletions(-)

diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index a85909b..dfd4f8d 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -21,6 +21,7 @@
 
 static Popup_Button btn_pressed;
 static Evas_Object *popup;
+static Evas_Object *helper;
 static Evas_Object *fs;
 static Evas_Smart_Cb dismiss_func;
 static void* func_data;
@@ -124,17 +125,17 @@ popup_buttons_disabled_set(Popup_Button popup_btns, 
Eina_Bool disabled)
 }
 
 static void
-_popup_dismiss(void *data __UNUSED__,
-               Evas_Object *obj __UNUSED__,
-               const char *signal __UNUSED__,
-               const char *source __UNUSED__)
+_helper_dismiss(void *data __UNUSED__,
+                Evas_Object *obj __UNUSED__,
+                const char *signal __UNUSED__,
+                const char *source __UNUSED__)
 {
-   evas_object_del(popup);
+   evas_object_del(helper);
 }
 
 static void
 _done(void *data __UNUSED__,
-      Evas_Object *obj __UNUSED__,
+      Evas_Object *obj,
       void *event_info __UNUSED__)
 {
    Eina_List *selected_paths = NULL;
@@ -154,33 +155,33 @@ _done(void *data __UNUSED__,
                selected = elm_fileselector_path_get(fs);
              selected_paths = eina_list_append(selected_paths, selected);
           }
-        ((Evas_Smart_Cb)dismiss_func)(func_data, NULL, selected_paths);
+        ((Evas_Smart_Cb)dismiss_func)(func_data, obj, selected_paths);
      }
    eina_list_free(selected_paths);
    dismiss_func = NULL;
    func_data = NULL;
-   _popup_dismiss(NULL, NULL, data, NULL);
+   _helper_dismiss(NULL, NULL, data, NULL);
 }
 
 #define FS_W 430
 #define FS_H 460
 
 static void
-_popup_obj_follow(void *data __UNUSED__,
-                  Evas *e __UNUSED__,
-                  Evas_Object *obj,
-                  void *event_info __UNUSED__)
+_helper_obj_follow(void *data __UNUSED__,
+                   Evas *e __UNUSED__,
+                   Evas_Object *obj,
+                   void *event_info __UNUSED__)
 {
    int x, y, w, h, nx, ny;
 
    evas_object_geometry_get(obj, &x, &y, &w, &h);
-   nx = x - (FS_W + 12 - w);
+   nx = x - (FS_W + 12 - w); /* 12 - it's a helper border */
    ny = y + h;
-   evas_object_move(popup, nx, ny);
+   evas_object_move(helper, nx, ny);
 }
 
 static void
-_popup_win_follow(void *data __UNUSED__,
+_helper_win_follow(void *data __UNUSED__,
                   Evas *e __UNUSED__,
                   Evas_Object *obj __UNUSED__,
                   void *event_info __UNUSED__)
@@ -190,7 +191,7 @@ _popup_win_follow(void *data __UNUSED__,
    evas_object_geometry_get(ap.win, NULL, NULL, &w, &h);
    nx = (w / 2) - ((FS_W + 12) / 2);
    ny = (h / 2) - ((FS_H + 12) / 2);
-   evas_object_move(popup, nx, ny);
+   evas_object_move(helper, nx, ny);
 }
 
 static void
@@ -208,9 +209,9 @@ _fileselector_helper(const char *title,
    dismiss_func = func;
    func_data = data;
 
-   popup = elm_layout_add(ap.win);
-   elm_layout_theme_set(popup, "layout", "popup", title ? "hint_title" : 
"hint");
-   elm_layout_signal_callback_add(popup, "hint,dismiss", "eflete", 
_popup_dismiss, NULL);
+   helper = elm_layout_add(ap.win);
+   elm_layout_theme_set(helper, "layout", "popup", title ? "hint_title" : 
"hint");
+   elm_layout_signal_callback_add(helper, "hint,dismiss", "eflete", 
_helper_dismiss, NULL);
 
    fs = elm_fileselector_add(ap.win);
    elm_fileselector_expandable_set(fs, false);
@@ -230,29 +231,29 @@ _fileselector_helper(const char *title,
    evas_object_hide(elm_layout_content_unset(fs, "elm.swallow.cancel"));
    /* one more hack, set text our text to button 'ok' */
    elm_object_text_set(elm_layout_content_get(fs, "elm.swallow.ok"), 
_("Open"));
-   evas_object_size_hint_min_set(popup, FS_W, FS_H);
-   evas_object_resize(popup, FS_W, FS_H);
+   evas_object_size_hint_min_set(helper, FS_W, FS_H);
+   evas_object_resize(helper, FS_W, FS_H);
 
    /* scroller is necessary to fix issues with fileselector size */
    SCROLLER_ADD(ap.win, scroller);
    elm_object_content_set(scroller, fs);
 
-   if (title) elm_object_text_set(popup, title);
-   elm_layout_content_set(popup, "elm.swallow.content", scroller);
+   if (title) elm_object_text_set(helper, title);
+   elm_layout_content_set(helper, "elm.swallow.content", scroller);
    evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
    if (follow_up)
      {
-        _popup_obj_follow(NULL, NULL, follow_up, NULL);
-        evas_object_event_callback_add(follow_up, EVAS_CALLBACK_RESIZE, 
_popup_obj_follow, NULL);
-        evas_object_event_callback_add(follow_up, EVAS_CALLBACK_MOVE, 
_popup_obj_follow, NULL);
+        _helper_obj_follow(NULL, NULL, follow_up, NULL);
+        evas_object_event_callback_add(follow_up, EVAS_CALLBACK_RESIZE, 
_helper_obj_follow, NULL);
+        evas_object_event_callback_add(follow_up, EVAS_CALLBACK_MOVE, 
_helper_obj_follow, NULL);
      }
    else
      {
-        _popup_win_follow(NULL, NULL, NULL, NULL);
-        evas_object_event_callback_add(ap.win, EVAS_CALLBACK_RESIZE, 
_popup_win_follow, NULL);
+        _helper_win_follow(NULL, NULL, NULL, NULL);
+        evas_object_event_callback_add(ap.win, EVAS_CALLBACK_RESIZE, 
_helper_win_follow, NULL);
      }
-   evas_object_show(popup);
+   evas_object_show(helper);
 }
 
 void
@@ -308,25 +309,25 @@ popup_log_message_helper(const char *msg)
 {
    Evas_Object *box, *en, *lab;
 
-   popup = elm_layout_add(ap.win);
-   elm_layout_theme_set(popup, "layout", "popup", "hint");
-   elm_layout_signal_callback_add(popup, "hint,dismiss", "eflete", 
_popup_dismiss, NULL);
+   helper = elm_layout_add(ap.win);
+   elm_layout_theme_set(helper, "layout", "popup", "hint");
+   elm_layout_signal_callback_add(helper, "hint,dismiss", "eflete", 
_helper_dismiss, NULL);
 
-   BOX_ADD(popup, box, false, false)
+   BOX_ADD(helper, box, false, false)
    elm_box_padding_set(box, 0, 6);
-   LABEL_ADD(popup, lab, _("<font_size=14>Import edc-file error"))
+   LABEL_ADD(helper, lab, _("<font_size=14>Import edc-file error"))
    evas_object_show(lab);
    ENTRY_ADD(box, en, false)
    elm_entry_editable_set(en, false);
    elm_box_pack_end(box, lab);
    elm_box_pack_end(box, en);
-   elm_layout_content_set(popup, NULL, box);
+   elm_layout_content_set(helper, NULL, box);
 
    elm_entry_entry_set(en, msg);
 
-   _popup_win_follow(NULL, NULL, NULL, NULL);
-   evas_object_event_callback_add(ap.win, EVAS_CALLBACK_RESIZE, 
_popup_win_follow, NULL);
-   evas_object_show(popup);
+   _helper_win_follow(NULL, NULL, NULL, NULL);
+   evas_object_event_callback_add(ap.win, EVAS_CALLBACK_RESIZE, 
_helper_win_follow, NULL);
+   evas_object_show(helper);
 }
 
 #undef FS_W

-- 


Reply via email to