Moved common widget layouts to apps-common. 86/95986/2
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 7 Nov 2016 12:01:08 +0000 (14:01 +0200)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 7 Nov 2016 12:01:08 +0000 (14:01 +0200)
Change-Id: I12ea149d63665b4c3f5d499e237bb95a46598d9a
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
contacts-widget/project_def.prop
contacts-widget/res/widget/CMakeLists.txt
contacts-widget/res/widget/edje/WidgetPath.h
contacts-widget/src/Widget.cpp
lib-apps-common/edje/apps-common/images/widget_no_contents_bg.#.png [moved from contacts-widget/edje/widget/images/nocontacts_bg.#.png with 100% similarity]
lib-apps-common/edje/apps-common/images/widget_no_contents_bg_stroke.#.png [moved from contacts-widget/edje/widget/images/nocontacts_bg_stroke.#.png with 100% similarity]
lib-apps-common/project_def.prop
lib-apps-common/res/apps-common/CMakeLists.txt
lib-apps-common/res/apps-common/edje/AppsCommonWidget.h [moved from contacts-widget/res/widget/edje/WidgetLayout.h with 52% similarity]
lib-apps-common/res/apps-common/edje/apps-common-buttons.edc
lib-apps-common/res/apps-common/edje/apps-common-widget.edc [moved from contacts-widget/res/widget/edje/widget-layout.edc with 69% similarity]

index 0478592..5245494 100644 (file)
@@ -60,7 +60,7 @@ USER_EDCS_FONT_DIRS_ABS =
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0
 
-USER_EXT_EDC0_EDCS = res/widget/edje/widget-layout.edc res/widget/edje/widget-item-layout.edc
+USER_EXT_EDC0_EDCS = res/widget/edje/widget-item-layout.edc
 USER_EXT_EDC0_EDCS_IMAGE_DIRS = edje
 USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
 USER_EXT_EDC0_EDCS_SOUND_DIRS = edje
index f34ffdb..0d6db9f 100644 (file)
@@ -1,4 +1,4 @@
-set(EDC_FILES widget-layout.edc widget-item-layout.edc)
+set(EDC_FILES widget-item-layout.edc)
 set(EDJ_DIR "${RES_DIR}/widget/edje")
 set(IMG_DIR "${RES_DIR}/widget/images")
 
index fbee14e..cba2846 100644 (file)
 #define WIDGET_IMG_DIR          "widget/images/"
 #define WIDGET_EDJ_DIR          "widget/edje/"
 
-#define WIDGET_LAYOUT_EDJ       WIDGET_EDJ_DIR"widget-layout.edj"
 #define WIDGET_ITEM_LAYOUT_EDJ  WIDGET_EDJ_DIR"widget-item-layout.edj"
 
-#define NO_CONTENTS_BG          WIDGET_IMG_DIR"nocontacts_bg.#.png"
-#define NO_CONTENTS_BORDER      WIDGET_IMG_DIR"nocontacts_bg_stroke.#.png"
-
 #define BUTTON_ADD_ICON         WIDGET_IMG_DIR"add_contact_icon.png"
 #define BUTTON_ADD_BG           WIDGET_IMG_DIR"add_contact_bg.png"
 #define BUTTON_ADD_BORDER       WIDGET_IMG_DIR"add_contact_bg_ef.png"
index b4f4ac5..63fee92 100644 (file)
@@ -26,9 +26,9 @@
 #include "Utils/Logger.h"
 
 #include "AppsCommonButtons.h"
+#include "AppsCommonWidget.h"
 #include "AddButtonItem.h"
 #include "WidgetItemLayout.h"
-#include "WidgetLayout.h"
 
 #include <notification.h>
 
@@ -43,7 +43,7 @@ using namespace std::placeholders;
 
 namespace
 {
-       const std::string layoutPath = App::getResourcePath(WIDGET_LAYOUT_EDJ);
+       const std::string layoutPath = App::getResourcePath(APPS_COMMON_WIDGET_EDJ);
 }
 
 Widget::Widget()
@@ -109,9 +109,9 @@ Evas_Object *Widget::createEmptyLayout(Evas_Object *parent)
        elm_layout_signal_callback_add(layout, "mouse,clicked,*", "*",
                        (Edje_Signal_Cb) makeCallback(&Widget::onAddPressed), this);
 
-       elm_object_translatable_part_text_set(layout, PART_TITLE,
+       elm_object_translatable_part_text_set(layout, "elm.text",
                        "IDS_PB_BODY_CONTACTS");
-       elm_object_translatable_part_text_set(layout, PART_HELP,
+       elm_object_translatable_part_text_set(layout, "elm.help.text",
                        "IDS_PB_NPBODY_TAP_HERE_TO_ADD_SHORTCUT");
 
        return layout;
@@ -120,8 +120,8 @@ Evas_Object *Widget::createEmptyLayout(Evas_Object *parent)
 Evas_Object *Widget::createLayout(Evas_Object *parent)
 {
        Evas_Object *layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, layoutPath.c_str(), LAYOUT_MAIN);
-       elm_object_part_content_set(layout, PART_BUTTON_EDIT, createEditButton(layout));
+       elm_layout_file_set(layout, layoutPath.c_str(), LAYOUT_CONTENT);
+       elm_object_part_content_set(layout, PART_BUTTON, createEditButton(layout));
        elm_object_part_content_set(layout, PART_CONTENT, createGengrid(layout));
 
        return layout;
@@ -148,12 +148,6 @@ Evas_Object *Widget::createEditButton(Evas_Object *parent)
        evas_object_smart_callback_add(m_EditButton, "clicked",
                        makeCallback(&Widget::onEditPressed), this);
 
-       Evas_Object *edje = elm_layout_edje_get(m_EditButton);
-       edje_object_color_class_set(edje, BUTTON_COLOR_CLASS_NORMAL, COLOR_BUTTON_EDIT_NORMAL,
-                       0, 0, 0, 0, 0, 0, 0, 0);
-       edje_object_text_class_set(edje, "button_text",
-                       "font=Tizen:style=Regular", BUTTON_TEXT_SIZE);
-
        return m_EditButton;
 }
 
index 53fb519..720ec33 100644 (file)
@@ -60,7 +60,7 @@ USER_EDCS_FONT_DIRS_ABS =
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0
 
-USER_EXT_EDC0_EDCS = res/apps-common/edje/apps-common-buttons.edc res/apps-common/edje/apps-common-popup.edc res/apps-common/edje/apps-common-thumbnail.edc
+USER_EXT_EDC0_EDCS = res/apps-common/edje/apps-common-buttons.edc res/apps-common/edje/apps-common-popup.edc res/apps-common/edje/apps-common-thumbnail.edc res/apps-common/edje/apps-common-widget.edc
 USER_EXT_EDC0_EDCS_IMAGE_DIRS = edje
 USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
 USER_EXT_EDC0_EDCS_SOUND_DIRS = edje
index 4ad50f1..18685fa 100644 (file)
@@ -1,4 +1,4 @@
-set(EDCFILES apps-common-buttons.edc apps-common-popup.edc apps-common-thumbnail.edc)
+set(EDCFILES apps-common-buttons.edc apps-common-popup.edc apps-common-thumbnail.edc apps-common-widget.edc)
 set(EDJDIR "${RES_DIR}/apps-common/edje")
 
 foreach(EDCFILE ${EDCFILES})
  * limitations under the License.
  */
 
-#ifndef WIDGET_LAYOUT_H
-#define WIDGET_LAYOUT_H
+#ifndef APPS_COMMON_WIDGET_H
+#define APPS_COMMON_WIDGET_H
 
-#include "WidgetPath.h"
+#include "AppsCommonPath.h"
 
-#define LAYOUT_NO_CONTENTS  "no_contents"
-#define LAYOUT_MAIN         "main"
+#define APPS_COMMON_WIDGET_EDJ  APPS_COMMON_EDJ_DIR"apps-common-widget.edj"
 
-#define PART_TITLE          "text.title"
-#define PART_HELP           "text.help"
+#define NO_CONTENTS_BG          APPS_COMMON_IMG_DIR"widget_no_contents_bg.#.png"
+#define NO_CONTENTS_BORDER      APPS_COMMON_IMG_DIR"widget_no_contents_bg_stroke.#.png"
 
-#define PART_BUTTON_EDIT    "swallow.button_edit"
-#define PART_CONTENT        "swallow.content"
+#define LAYOUT_NO_CONTENTS      "no_contents"
+#define LAYOUT_CONTENT          "content"
 
-#define BUTTON_TEXT_SIZE 32
-#define COLOR_BUTTON_EDIT_NORMAL    0, 0, 0, 90
+#define PART_BUTTON             "swallow.button"
+#define PART_CONTENT            "swallow.content"
 
-#endif /* WIDGET_LAYOUT_H */
+#endif /* APPS_COMMON_WIDGET_H */
index e8d2451..65991d4 100644 (file)
@@ -224,6 +224,18 @@ collections {
                                }
                        }
                }
+               programs {
+                       program {
+                               name: "loaded";
+                               signal: "load";
+                               source: "*";
+                               script {
+                                       set_float(effect_scale, 0.7);
+                                       set_color_class(BUTTON_COLOR_CLASS_NORMAL, 0, 0, 0, 90);
+                                       set_text_class(BUTTON_TEXT_CLASS, "font=Tizen:style=Regular", 32);
+                               }
+                       }
+               }
        }
 
        group { "elm/button/base/"STYLE_BUTTON_CUSTOM_CIRCLE;
  * limitations under the License.
  */
 
-#include "WidgetLayout.h"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
+#include "AppsCommonWidget.h"
+#include "apps-common-utils.edc"
 
-#define TITLE_H 107
-#define TITLE_T 72
-#define TITLE_TEXT_SIZE 80
+#define TEXT_H 107
+#define TEXT_T 72
+#define TEXT_SIZE 80
 
 #define HELP_H 52
 #define HELP_T 15
 #define HELP_TEXT_SIZE 38
 
-#define BUTTON_EDIT_H 52
-#define BUTTON_EDIT_R 14
+#define BUTTON_R 14
+#define CONTENT_T 10
 
 styles {
        style {
-               name: "no_contents_title";
-               base: "font=Tizen:style=Condensed font_size="TITLE_TEXT_SIZE" align=center color=#fafafa style=shadow,bottom_right shadow_color=#00000066";
+               name: "no_contents_text";
+               base: "font=Tizen:style=Condensed font_size="TEXT_SIZE" align=center color=#fafafa style=shadow,bottom_right shadow_color=#00000066";
        }
        style {
-               name: "no_contents_text";
+               name: "no_contents_help";
                base: "font=Tizen:style=Regular font_size="HELP_TEXT_SIZE" align=center color=#fafafa style=shadow,bottom_right shadow_color=#00000066";
        }
 }
@@ -81,42 +81,35 @@ collections {
                        }
                        spacer { "spacer.text.top"; scale;
                                desc { "default";
-                                       min: 0 TITLE_T;
+                                       min: 0 TEXT_T;
                                        align: 0.5 0.0;
-                                       rel1.relative: 0.0 0.0;
                                        rel2.relative: 1.0 0.0;
                                }
                        }
-                       textblock { PART_TITLE; scale;
+                       textblock { "elm.text"; scale;
                                desc { "default";
-                                       min: 0 TITLE_H;
+                                       min: 0 TEXT_H;
                                        align: 0.5 0.0;
                                        rel1 { relative: 0.0 1.0; to_y: "spacer.text.top"; }
                                        rel2 { relative: 1.0 1.0; to_y: "spacer.text.top"; }
-                                       text {
-                                               align: 0.5 0.0;
-                                               style: "no_contents_title";
-                                       }
+                                       text.style: "no_contents_text";
                                }
                        }
                        spacer { "spacer.help.top"; scale;
                                desc { "default";
                                        min: 0 HELP_T;
                                        align: 0.5 0.0;
-                                       rel1 { relative: 0.0 1.0; to_y: PART_TITLE; }
-                                       rel2 { relative: 1.0 1.0; to_y: PART_TITLE; }
+                                       rel1 { relative: 0.0 1.0; to_y: "elm.text"; }
+                                       rel2 { relative: 1.0 1.0; to_y: "elm.text"; }
                                }
                        }
-                       textblock { PART_HELP; scale;
+                       textblock { "elm.help.text"; scale;
                                desc { "default";
                                        min: 0 HELP_H;
                                        align: 0.5 0.0;
                                        rel1 { relative: 0.0 1.0; to_y: "spacer.help.top"; }
                                        rel2 { relative: 1.0 1.0; to_y: "spacer.help.top"; }
-                                       text {
-                                               align: 0.5 0.0;
-                                               style: "no_contents_text";
-                                       }
+                                       text.style: "no_contents_help";
                                }
                        }
                        programs {
@@ -140,29 +133,34 @@ collections {
                }
        }
 
-       group { LAYOUT_MAIN;
+       group { LAYOUT_CONTENT;
                parts {
-                       spacer { "spacer.button_edit.right"; scale;
+                       spacer { "spacer.button.right"; scale;
                                desc { "default";
-                                       min: BUTTON_EDIT_R 0;
+                                       min: BUTTON_R 0;
                                        align: 1.0 0.5;
                                        rel1.relative: 1.0 0.0;
-                                       rel2.relative: 1.0 1.0;
                                }
                        }
-                       swallow { PART_BUTTON_EDIT; scale;
+                       swallow { PART_BUTTON;
                                desc { "default";
-                                       min: 0 BUTTON_EDIT_H;
                                        align: 1.0 0.0;
-                                       rel1 { relative: 0.0 0.0; to_x: "spacer.button_edit.right"; }
-                                       rel2 { relative: 0.0 0.0; to_x: "spacer.button_edit.right"; }
+                                       rel1 { relative: 0.0 0.0; to_x: "spacer.button.right"; }
+                                       rel2 { relative: 0.0 0.0; to_x: "spacer.button.right"; }
+                               }
+                       }
+                       spacer { "spacer.content.top"; scale;
+                               desc { "default";
+                                       min: 0 CONTENT_T;
+                                       align: 0.5 0.0;
+                                       rel1 { relative: 0.0 1.0; to_y: PART_BUTTON; }
+                                       rel2 { relative: 1.0 1.0; to_y: PART_BUTTON; }
                                }
                        }
-                       swallow { PART_CONTENT; scale;
+                       swallow { PART_CONTENT;
                                desc { "default";
                                        align: 0.5 0.0;
-                                       rel1 { relative: 0.0 1.0; to_y: PART_BUTTON_EDIT; }
-                                       rel2 { relative: 1.0 1.0; }
+                                       rel1 { relative: 0.0 1.0; to_y: "spacer.content.top"; }
                                }
                        }
                }