change app-selector popup layout following black theme 80/17880/2
authorHyungdeuk Kim <hd3.kim@samsung.com>
Sat, 29 Jun 2013 11:05:35 +0000 (20:05 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Wed, 12 Mar 2014 05:13:49 +0000 (14:13 +0900)
Change-Id: I10bc077163ac0fc2f52d444abd8aac888b6ebeed

CMakeLists.txt
app-selector-view.c
app-selector.h
data/app-selector.edc [new file with mode: 0755]
data/groups/icon.edc [moved from app-selector.edc with 97% similarity]
data/groups/popup.edc [new file with mode: 0755]
packaging/org.tizen.app-selector.spec

index 230c461..9b6fb35 100755 (executable)
@@ -53,8 +53,8 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie")
 
 ADD_CUSTOM_TARGET(app-selector.edj
                COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/images
-               ${CMAKE_SOURCE_DIR}/app-selector.edc ${CMAKE_BINARY_DIR}/app-selector.edj
-               DEPENDS ${CMAKE_SOURCE_DIR}/app-selector.edc
+               ${CMAKE_SOURCE_DIR}/data/app-selector.edc ${CMAKE_BINARY_DIR}/app-selector.edj
+               DEPENDS ${CMAKE_SOURCE_DIR}/data/app-selector.edc
 )
 ADD_DEPENDENCIES(${PROJECT_NAME} app-selector.edj)
 
index 91ca8fc..1e5688b 100755 (executable)
@@ -515,7 +515,7 @@ static Evas_Object *__app_genlist_add(struct appdata *ad)
        if (ad->app_genlist)
                return NULL;
 
-       genlist = elm_genlist_add(ad->popup);
+       genlist = elm_genlist_add(ad->layout);
 
        evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND,
                                         EVAS_HINT_EXPAND);
@@ -529,19 +529,32 @@ static void __load_app_list(struct appdata *ad)
 {
        Evas_Object *popup;
        Evas_Object *btn1;
+       Evas_Object *layout;
+       Evas_Object *box;
+
+       double scale = elm_config_scale_get();
+       _D("scale : %f", scale);
 
        popup = elm_popup_add(ad->win);
-       elm_object_style_set(popup, "menustyle");
+       elm_object_style_set(popup,"content_no_vhpad");
        ad->popup = popup;
 
-       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
-                                        EVAS_HINT_EXPAND);
-
        elm_object_part_text_set(popup, "title,text", _("IDS_TASKMGR_HEADER_SELECT_APPLICATION"));
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       layout = elm_layout_add(popup);
+       elm_layout_theme_set(layout, "layout", "content", "min_menustyle");
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       ad->layout = layout;
 
        btn1 = elm_button_add(popup);
+       elm_object_style_set(btn1, "popup_button/default");
        elm_object_text_set(btn1, dgettext("sys_string", "IDS_COM_SK_CANCEL"));
        elm_object_part_content_set(popup, "button1", btn1);
+       evas_object_smart_callback_add(btn1, "clicked", __response_cb, ad);
+
+       box = elm_box_add(layout);
+       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        ad->app_genlist = __app_genlist_add(ad);
        if (!ad->app_genlist)
@@ -549,8 +562,16 @@ static void __load_app_list(struct appdata *ad)
 
        __app_genlist_item_append(ad);
 
-       elm_object_content_set(popup, ad->app_genlist);
-       evas_object_smart_callback_add(btn1, "clicked", __response_cb, ad);
+       elm_box_pack_end(box, ad->app_genlist);
+       evas_object_show(ad->app_genlist);
+
+
+       evas_object_size_hint_min_set(box, (int)(610*scale), (int)(400*scale));
+       evas_object_show(box);
+
+
+       elm_object_part_content_set(layout, "elm.swallow.content" , box);
+       elm_object_content_set(popup, box);
 
        evas_object_show(popup);
 }
index d2a060c..07888e9 100755 (executable)
@@ -56,6 +56,7 @@ struct appdata {
        Ecore_Event_Handler *rotate;
 
        Evas_Object *popup;
+       Evas_Object *layout;
 
        Eina_List *app_list;
        Evas_Object *app_genlist;
diff --git a/data/app-selector.edc b/data/app-selector.edc
new file mode 100755 (executable)
index 0000000..ee73b2d
--- /dev/null
@@ -0,0 +1,4 @@
+collections {
+#include "groups/popup.edc"
+#include "groups/icon.edc"
+}
similarity index 97%
rename from app-selector.edc
rename to data/groups/icon.edc
index a576116..44a8126 100644 (file)
@@ -1,5 +1,4 @@
 
-collections {
        group {
                name: "icon";
                parts {
@@ -36,5 +35,3 @@ collections {
                        }
                }
        }
-
-}
diff --git a/data/groups/popup.edc b/data/groups/popup.edc
new file mode 100755 (executable)
index 0000000..948ef23
--- /dev/null
@@ -0,0 +1,136 @@
+
+
+#define POPUP_CONTENT_LISTSTYLE_PADDING_RIGHT_MIN_INC 3 0
+#define POPUP_CONTENT_LISTSTYLE_CONTENT_DEFAULT_MIN_INC 610 250
+#define POPUP_CONTENT_LISTSTYLE_PADDING_RIGHT_MIN_INC 3 0
+
+#define DEMO_POPUP_CONTENT_MINSTYLE_CONTENT_DEFAULT_MIN_INC 0 0
+#define DEMO_POPUP_CONTENT_LISTSTYLE_CONTENT_DEFAULT_MIN_INC 0 400
+
+group { name: "elm/popup/content/selectorstyle";
+   parts{
+      part { name: "left_padding";
+         type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            visible: 0;
+            align: 0.0 0.5;
+            min: POPUP_CONTENT_LISTSTYLE_PADDING_RIGHT_MIN_INC;
+            rel1 {
+               relative: 0.0 0.0;
+            }
+            rel2 {
+               relative: 0.0 1.0;
+            }
+         }
+      }
+      part{ name:"elm.swallow.content";
+         type: SWALLOW;
+         scale : 1;
+         description { state: "default" 0.0;
+            min: POPUP_CONTENT_LISTSTYLE_CONTENT_DEFAULT_MIN_INC;
+            max: POPUP_CONTENT_LISTSTYLE_CONTENT_DEFAULT_MIN_INC;
+            align: 0.5 0.5;
+            fixed: 1 0;
+            rel1 {
+               relative: 1.0 0.0;
+               to:"left_padding";
+            }
+            rel2 {
+               relative: 0.0 1.0;
+               to:"right_padding";
+            }
+         }
+      }
+      part { name: "right_padding";
+         type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            fixed: 1 0;
+            visible: 0;
+            align: 1.0 0.5;
+            min: POPUP_CONTENT_LISTSTYLE_PADDING_RIGHT_MIN_INC;
+            rel1 {
+               relative: 1.0 0.0;
+            }
+            rel2 {
+               relative: 1.0 1.0;
+            }
+         }
+      }
+   }
+}
+
+group { name: "elm/layout/content/min_menustyle";
+   parts{
+      part { name: "left_pad";
+         type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 16 0;
+            align: 0.0 0.0;
+            fixed: 1 0;
+            rel2.relative: 0.0 1.0;
+         }
+      }
+      part { name: "right_pad";
+         type: RECT;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: 16 0;
+            align: 1.0 1.0;
+            fixed: 1 0;
+            rel1.relative: 0.0 1.0;
+         }
+      }
+      part{ name:"elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: DEMO_POPUP_CONTENT_MINSTYLE_CONTENT_DEFAULT_MIN_INC;
+            max: DEMO_POPUP_CONTENT_MINSTYLE_CONTENT_DEFAULT_MIN_INC;
+            align: 0.5 0.5;
+            fixed: 1 0;
+            rel1 {
+               relative: 1.0 1.0;
+               to: "left_pad";
+            }
+            rel2 {
+               relative: 0.0 0.0;
+               to: "right_pad";
+            }
+         }
+      }
+   }
+}
+
+group { name: "elm/layout/content/liststyle";
+   parts{
+      part{ name:"elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: DEMO_POPUP_CONTENT_LISTSTYLE_CONTENT_DEFAULT_MIN_INC;
+            align: 0.5 0.5;
+            fixed: 1 0;
+         }
+      }
+   }
+}
+
+group { name: "elm/layout/content/min_liststyle";
+   parts{
+      part{ name:"elm.swallow.content";
+         type: SWALLOW;
+         scale: 1;
+         description { state: "default" 0.0;
+            min: DEMO_POPUP_CONTENT_MINSTYLE_CONTENT_DEFAULT_MIN_INC;
+            align: 0.5 0.5;
+            fixed: 1 0;
+         }
+      }
+   }
+}
+
+
index 6e6da21..d468c74 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       org.tizen.app-selector
 Summary:    Application selector
 Version:    0.1.0
-Release:    91
+Release:    92
 Group:      TO_BE/FILLED_IN
 License:    Flora Software License
 Source0:    %{name}-%{version}.tar.gz