rimmed pushed a commit to branch master.

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

commit 3299a79d75c9671e4581791794138c209da1e083
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Oct 6 16:28:03 2015 +0300

    popup: add title for fileselector helper
    
    Change-Id: I02f2f2a333aa37fd92f8f040371cffc953f76577
---
 src/bin/ui/main_window.h         |  2 +-
 src/bin/ui/popup.c               | 26 ++++++++++++++++----------
 src/bin/ui/tab_home_import_edj.c |  2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/bin/ui/main_window.h b/src/bin/ui/main_window.h
index 9fa6a25..0df1619 100644
--- a/src/bin/ui/main_window.h
+++ b/src/bin/ui/main_window.h
@@ -418,7 +418,7 @@ void
 popup_fileselector_folder_helper(Evas_Object *entry, const char *path);
 
 void
-popup_fileselector_edj_helper(Evas_Object *entry, const char *path);
+popup_fileselector_edj_helper(const char *title, Evas_Object *entry, const 
char *path);
 
 void
 popup_fileselector_edc_helper(Evas_Object *entry, const char *path);
diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index 96a35c7..2098f76 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -151,7 +151,7 @@ _popup_obj_follow(void *data __UNUSED__,
    int x, y, w, h, nx, ny;
 
    evas_object_geometry_get(obj, &x, &y, &w, &h);
-   nx = x - (FS_W - w);
+   nx = x - (FS_W + 12 - w);
    ny = y + h;
    evas_object_move(popup, nx, ny);
 }
@@ -165,18 +165,22 @@ _popup_win_follow(void *data __UNUSED__,
    int w, h, nx, ny;
 
    evas_object_geometry_get(ap.win, NULL, NULL, &w, &h);
-   nx = (w / 2) - (FS_W / 2);
-   ny = (h / 2) - (FS_H / 2);
+   fprintf(stdout, "%d %d\n", w, h);
+   nx = (w / 2) - ((FS_W + 12) / 2);
+   ny = (h / 2) - ((FS_H + 12) / 2);
    evas_object_move(popup, nx, ny);
 }
 
 static void
-_fileselector_helper(Evas_Object *entry, const char *path, 
Elm_Fileselector_Filter_Func filter_cb)
+_fileselector_helper(const char *title,
+                     Evas_Object *entry,
+                     const char *path,
+                     Elm_Fileselector_Filter_Func filter_cb)
 {
    Evas_Object *fs;
 
    popup = elm_layout_add(ap.win);
-   elm_layout_theme_set(popup, "layout", "popup", "hint");
+   elm_layout_theme_set(popup, "layout", "popup", title ? "hint_title" : 
"hint");
    elm_layout_signal_callback_add(popup, "hint,dismiss", "eflete", 
_popup_dismiss, NULL);
 
    fs = elm_fileselector_add(ap.win);
@@ -195,9 +199,11 @@ _fileselector_helper(Evas_Object *entry, const char *path, 
Elm_Fileselector_Filt
    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(fs, FS_W, FS_H);
    evas_object_resize(fs, FS_W, FS_H);
-   elm_layout_content_set(popup, "elm.swallow.content", fs);
 
+   if (title) elm_object_text_set(popup, title);
+   elm_layout_content_set(popup, "elm.swallow.content", fs);
    if (entry)
      {
         _popup_obj_follow(NULL, NULL, entry, NULL);
@@ -215,7 +221,7 @@ _fileselector_helper(Evas_Object *entry, const char *path, 
Elm_Fileselector_Filt
 void
 popup_fileselector_folder_helper(Evas_Object *entry, const char *path)
 {
-   _fileselector_helper(entry, path, NULL);
+   _fileselector_helper(NULL, entry, path, NULL);
 }
 
 static Eina_Bool
@@ -231,9 +237,9 @@ _edj_filter(const char *path,
 }
 
 void
-popup_fileselector_edj_helper(Evas_Object *entry, const char *path)
+popup_fileselector_edj_helper(const char *title, Evas_Object *entry, const 
char *path)
 {
-   _fileselector_helper(entry, path, _edj_filter);
+   _fileselector_helper(title, entry, path, _edj_filter);
 }
 
 static Eina_Bool
@@ -251,7 +257,7 @@ _edc_filter(const char *path,
 void
 popup_fileselector_edc_helper(Evas_Object *entry, const char *path)
 {
-   _fileselector_helper(entry, path, _edc_filter);
+   _fileselector_helper(NULL, entry, path, _edc_filter);
 }
 
 void
diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c
index 60aa3b4..5a9d4e2 100644
--- a/src/bin/ui/tab_home_import_edj.c
+++ b/src/bin/ui/tab_home_import_edj.c
@@ -130,7 +130,7 @@ _elipsis_edj(void *data __UNUSED__,
              Evas_Object *obj __UNUSED__,
              void *event_info __UNUSED__)
 {
-   popup_fileselector_edj_helper(tab_edj.edj, NULL);
+   popup_fileselector_edj_helper(NULL, tab_edj.edj, NULL);
 }
 
 Evas_Object *

-- 


Reply via email to