# 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
-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")
+++ /dev/null
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WIDGET_LAYOUT_H
-#define WIDGET_LAYOUT_H
-
-#include "WidgetPath.h"
-
-#define LAYOUT_NO_CONTENTS "no_contents"
-#define LAYOUT_MAIN "main"
-
-#define PART_TITLE "text.title"
-#define PART_HELP "text.help"
-
-#define PART_BUTTON_EDIT "swallow.button_edit"
-#define PART_CONTENT "swallow.content"
-
-#define BUTTON_TEXT_SIZE 32
-#define COLOR_BUTTON_EDIT_NORMAL 0, 0, 0, 90
-
-#endif /* WIDGET_LAYOUT_H */
#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"
+++ /dev/null
-/*
- * Copyright 2016 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "WidgetLayout.h"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
-
-#define TITLE_H 107
-#define TITLE_T 72
-#define TITLE_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
-
-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";
- }
- style {
- name: "no_contents_text";
- base: "font=Tizen:style=Regular font_size="HELP_TEXT_SIZE" align=center color=#fafafa style=shadow,bottom_right shadow_color=#00000066";
- }
-}
-
-color_classes {
- color_class { //AO003
- name: "no_contents_bg";
- color: 0 0 0 13;
- }
- color_class {
- name: "no_contents_bg_pressed";
- color: 0 0 0 77;
- }
- color_class { //AO003L1
- name: "no_contents_border";
- color: 250 250 250 77;
- }
-}
-
-collections {
- base_scale: 2.6;
-
- group { LAYOUT_NO_CONTENTS;
- images {
- image: NO_CONTENTS_BG COMP;
- image: NO_CONTENTS_BORDER COMP;
- }
- parts {
- image { "image.bg";
- desc { "default";
- image.normal: NO_CONTENTS_BG;
- color_class: "no_contents_bg";
- }
- desc { "pressed";
- image.normal: NO_CONTENTS_BG;
- color_class: "no_contents_bg_pressed";
- }
- }
- image { "image.border";
- desc { "default";
- color_class: "no_contents_border";
- image.normal: NO_CONTENTS_BORDER;
- }
- }
- spacer { "spacer.text.top"; scale;
- desc { "default";
- min: 0 TITLE_T;
- align: 0.5 0.0;
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 0.0;
- }
- }
- textblock { PART_TITLE; scale;
- desc { "default";
- min: 0 TITLE_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";
- }
- }
- }
- 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; }
- }
- }
- textblock { PART_HELP; 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";
- }
- }
- }
- programs {
- program {
- name: "pressed";
- signal: "mouse,down,*";
- source: "*";
- action: STATE_SET "pressed" 0.0;
- target: "image.bg";
- transition: TRANSITION_GLIDE(0.15);
- }
- program {
- name: "unpressed";
- signal: "mouse,up,*";
- source: "*";
- action: STATE_SET "default" 0.0;
- target: "image.bg";
- transition: TRANSITION_GLIDE(0.45);
- }
- }
- }
- }
-
- group { LAYOUT_MAIN;
- parts {
- spacer { "spacer.button_edit.right"; scale;
- desc { "default";
- min: BUTTON_EDIT_R 0;
- align: 1.0 0.5;
- rel1.relative: 1.0 0.0;
- rel2.relative: 1.0 1.0;
- }
- }
- swallow { PART_BUTTON_EDIT; scale;
- 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"; }
- }
- }
- swallow { PART_CONTENT; scale;
- desc { "default";
- align: 0.5 0.0;
- rel1 { relative: 0.0 1.0; to_y: PART_BUTTON_EDIT; }
- rel2 { relative: 1.0 1.0; }
- }
- }
- }
- }
-}
#include "Utils/Logger.h"
#include "AppsCommonButtons.h"
+#include "AppsCommonWidget.h"
#include "AddButtonItem.h"
#include "WidgetItemLayout.h"
-#include "WidgetLayout.h"
#include <notification.h>
namespace
{
- const std::string layoutPath = App::getResourcePath(WIDGET_LAYOUT_EDJ);
+ const std::string layoutPath = App::getResourcePath(APPS_COMMON_WIDGET_EDJ);
}
Widget::Widget()
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;
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;
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;
}
# 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
-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})
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef APPS_COMMON_WIDGET_H
+#define APPS_COMMON_WIDGET_H
+
+#include "AppsCommonPath.h"
+
+#define APPS_COMMON_WIDGET_EDJ APPS_COMMON_EDJ_DIR"apps-common-widget.edj"
+
+#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 LAYOUT_NO_CONTENTS "no_contents"
+#define LAYOUT_CONTENT "content"
+
+#define PART_BUTTON "swallow.button"
+#define PART_CONTENT "swallow.content"
+
+#endif /* APPS_COMMON_WIDGET_H */
}
}
}
+ 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;
--- /dev/null
+/*
+ * Copyright 2016 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "AppsCommonWidget.h"
+#include "apps-common-utils.edc"
+
+#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_R 14
+#define CONTENT_T 10
+
+styles {
+ style {
+ 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_help";
+ base: "font=Tizen:style=Regular font_size="HELP_TEXT_SIZE" align=center color=#fafafa style=shadow,bottom_right shadow_color=#00000066";
+ }
+}
+
+color_classes {
+ color_class { //AO003
+ name: "no_contents_bg";
+ color: 0 0 0 13;
+ }
+ color_class {
+ name: "no_contents_bg_pressed";
+ color: 0 0 0 77;
+ }
+ color_class { //AO003L1
+ name: "no_contents_border";
+ color: 250 250 250 77;
+ }
+}
+
+collections {
+ base_scale: 2.6;
+
+ group { LAYOUT_NO_CONTENTS;
+ images {
+ image: NO_CONTENTS_BG COMP;
+ image: NO_CONTENTS_BORDER COMP;
+ }
+ parts {
+ image { "image.bg";
+ desc { "default";
+ image.normal: NO_CONTENTS_BG;
+ color_class: "no_contents_bg";
+ }
+ desc { "pressed";
+ image.normal: NO_CONTENTS_BG;
+ color_class: "no_contents_bg_pressed";
+ }
+ }
+ image { "image.border";
+ desc { "default";
+ color_class: "no_contents_border";
+ image.normal: NO_CONTENTS_BORDER;
+ }
+ }
+ spacer { "spacer.text.top"; scale;
+ desc { "default";
+ min: 0 TEXT_T;
+ align: 0.5 0.0;
+ rel2.relative: 1.0 0.0;
+ }
+ }
+ textblock { "elm.text"; scale;
+ desc { "default";
+ 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.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: "elm.text"; }
+ rel2 { relative: 1.0 1.0; to_y: "elm.text"; }
+ }
+ }
+ 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.style: "no_contents_help";
+ }
+ }
+ programs {
+ program {
+ name: "pressed";
+ signal: "mouse,down,*";
+ source: "*";
+ action: STATE_SET "pressed" 0.0;
+ target: "image.bg";
+ transition: TRANSITION_GLIDE(0.15);
+ }
+ program {
+ name: "unpressed";
+ signal: "mouse,up,*";
+ source: "*";
+ action: STATE_SET "default" 0.0;
+ target: "image.bg";
+ transition: TRANSITION_GLIDE(0.45);
+ }
+ }
+ }
+ }
+
+ group { LAYOUT_CONTENT;
+ parts {
+ spacer { "spacer.button.right"; scale;
+ desc { "default";
+ min: BUTTON_R 0;
+ align: 1.0 0.5;
+ rel1.relative: 1.0 0.0;
+ }
+ }
+ swallow { PART_BUTTON;
+ desc { "default";
+ align: 1.0 0.0;
+ 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;
+ desc { "default";
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to_y: "spacer.content.top"; }
+ }
+ }
+ }
+ }
+}