From 3fe506eabecd3d9258d22b7d6ec6af5023ee8fe5 Mon Sep 17 00:00:00 2001 From: Hyungdeuk Kim Date: Sat, 29 Jun 2013 20:05:35 +0900 Subject: [PATCH] change app-selector popup layout following black theme Change-Id: I10bc077163ac0fc2f52d444abd8aac888b6ebeed --- CMakeLists.txt | 4 +- app-selector-view.c | 35 ++++++-- app-selector.h | 1 + data/app-selector.edc | 4 + app-selector.edc => data/groups/icon.edc | 3 - data/groups/popup.edc | 136 +++++++++++++++++++++++++++++++ packaging/org.tizen.app-selector.spec | 2 +- 7 files changed, 172 insertions(+), 13 deletions(-) create mode 100755 data/app-selector.edc rename app-selector.edc => data/groups/icon.edc (97%) create mode 100755 data/groups/popup.edc diff --git a/CMakeLists.txt b/CMakeLists.txt index 230c461..9b6fb35 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/app-selector-view.c b/app-selector-view.c index 91ca8fc..1e5688b 100755 --- a/app-selector-view.c +++ b/app-selector-view.c @@ -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); } diff --git a/app-selector.h b/app-selector.h index d2a060c..07888e9 100755 --- a/app-selector.h +++ b/app-selector.h @@ -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 index 0000000..ee73b2d --- /dev/null +++ b/data/app-selector.edc @@ -0,0 +1,4 @@ +collections { +#include "groups/popup.edc" +#include "groups/icon.edc" +} diff --git a/app-selector.edc b/data/groups/icon.edc similarity index 97% rename from app-selector.edc rename to data/groups/icon.edc index a576116..44a8126 100644 --- a/app-selector.edc +++ b/data/groups/icon.edc @@ -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 index 0000000..948ef23 --- /dev/null +++ b/data/groups/popup.edc @@ -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; + } + } + } +} + + diff --git a/packaging/org.tizen.app-selector.spec b/packaging/org.tizen.app-selector.spec index 6e6da21..d468c74 100755 --- a/packaging/org.tizen.app-selector.spec +++ b/packaging/org.tizen.app-selector.spec @@ -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 -- 2.7.4