From b31ba8818171d69acdc140b4de882d36e825905a Mon Sep 17 00:00:00 2001 From: Oleksander Kostenko Date: Wed, 12 Jul 2017 14:01:09 +0300 Subject: [PATCH] TizenRefApp-8800 Fix GUI of no content layout Change-Id: Iab47396872185cc1dbf9f81b4223e26563d46fbf Signed-off-by: Oleksander Kostenko --- inc/Resource.h | 11 +- project_def.prop | 2 +- res/edje/defines.inl | 3 +- res/edje/main-layout.edc | 9 +- res/edje/no-content-layout.edc | 249 +++++++++++++++++++++++++++++++++++++++++ src/App/src/MainLayout.cpp | 4 +- 6 files changed, 262 insertions(+), 16 deletions(-) create mode 100644 res/edje/no-content-layout.edc diff --git a/inc/Resource.h b/inc/Resource.h index e9dde82..ea11a5d 100644 --- a/inc/Resource.h +++ b/inc/Resource.h @@ -20,10 +20,11 @@ #define EDJ_PATH "edje" #define IMAGE_PATH "images" -#define MAINT_LAYOUT_EDJ "main-layout.edj" -#define ANIM_ITEM_EDJ "anim-item.edj" -#define TASK_ITEM_EDJ "task-item.edj" -#define ICONS_EDJ "icons.edj" -#define APP_ICON_IMG "recent_no_recent_icon.png" +#define MAINT_LAYOUT_EDJ "main-layout.edj" +#define NO_CONTENT_LAYOUT_EDJ "no-content-layout.edj" +#define ANIM_ITEM_EDJ "anim-item.edj" +#define TASK_ITEM_EDJ "task-item.edj" +#define ICONS_EDJ "icons.edj" +#define APP_ICON_IMG "recent_no_recent_icon.png" #endif /* RESOURCE_H_ */ diff --git a/project_def.prop b/project_def.prop index 66ab44e..dc53df0 100644 --- a/project_def.prop +++ b/project_def.prop @@ -52,7 +52,7 @@ USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts # EDC Flags USER_EXT_EDC_KEYS = EDC0 -USER_EXT_EDC0_EDCS = res/edje/task-item.edc res/edje/main-layout.edc res/edje/icons.edc res/edje/anim-item.edc +USER_EXT_EDC0_EDCS = res/edje/no-content-layout.edc res/edje/task-item.edc res/edje/main-layout.edc res/edje/icons.edc res/edje/anim-item.edc USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts diff --git a/res/edje/defines.inl b/res/edje/defines.inl index 27712be..2e61bad 100644 --- a/res/edje/defines.inl +++ b/res/edje/defines.inl @@ -1,5 +1,4 @@ #define WIN_H 360 #define WIN_W 360 #define ITEM_W 245 -#define BASE_SCALE 1.3; - +#define BASE_SCALE 1.3; \ No newline at end of file diff --git a/res/edje/main-layout.edc b/res/edje/main-layout.edc index 2cb7024..f60927f 100644 --- a/res/edje/main-layout.edc +++ b/res/edje/main-layout.edc @@ -26,12 +26,11 @@ collections { } } styles { - style { - name: "style_no_apps"; - base: "font="TIZEN":style=Regular text_class="AT013" font_size=24 align=center color=#fafafa wrap=mixed color_class=AT013"; + style { name: "style_no_apps"; + base: "font="TIZEN":style=Regular text_class="AT013" font_size=24 align=center color=#fafafa wrap=mixed color_class=AT013"; tag: "br" "\n"; - tag: "hilight" "+ color=#ffff"; - tag: "b" "+ color=#ffff"; + tag: "hilight" "+ color=#ffff"; + tag: "b" "+ color=#ffff"; tag: "tab" "\t"; } } diff --git a/res/edje/no-content-layout.edc b/res/edje/no-content-layout.edc new file mode 100644 index 0000000..2c2f3bd --- /dev/null +++ b/res/edje/no-content-layout.edc @@ -0,0 +1,249 @@ +/* + * Copyright 2017 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 "defines.inl" + +#define NOITEM_TEXT_SIZE_INC 32 +#define NOITEM_TEXT_LR_PADDING_SIZE_INC 60 +#define NOITEM_IMAGE_SIZE_INC 98 +#define NOITEM_IMAGE_PADDING_HEIGHT_INC 37 +#define NOITEM_TITLE_TEXT_WIDTH_INC 232 +#define NOITEM_TITLE_TEXT_HEIGHT_INC 39 +#define NOITEM_TITLE_LR_PADDING_SIZE_INC 64 +#define NOITEM_TITLE_TOP_PADDING_SIZE_INC 51 +#define NOITEM_TITLE_BOTTOM_PADDING_SIZE_INC 41 + +collections { + base_scale: BASE_SCALE; + + styles { + style { name: "nocontent_title_style"; + base: "font=Tizen:weight=Bold:width=Condensed font_size=30 align=center color=#74C3FCFF text_class=tizen ellipsis=1.0"; + tag: "match" "+ color=#0e76b2ff"; + } + style { name: "nocontent_style"; + base: "font=Tizen:weight=Light:width=Condense font_size=28 align=center color=#fafafa text_class=label wrap=mixed "; + } + } + group { name: "no_content"; + images { + image: "recent_no_item_bg.png" COMP; + } + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 7 7 7 255; + } + } + part { + name: "bg_image"; + type: IMAGE; + scale: 1; + description { + state: "default" 0.0; + image.normal : "recent_no_item_bg.png"; + color: 94 94 94 51; + } + } + part { name: "title_top_padding"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 NOITEM_TITLE_TOP_PADDING_SIZE_INC; + max: -1 NOITEM_TITLE_TOP_PADDING_SIZE_INC; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.0; to: "bg"; } + } + } + part { name: "title_left_padding"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: NOITEM_TITLE_LR_PADDING_SIZE_INC 0; + max: NOITEM_TITLE_LR_PADDING_SIZE_INC -1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 0.0 0.0; to: "bg"; } + } + } + part { name: "title_right_padding"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: NOITEM_TITLE_LR_PADDING_SIZE_INC 0; + max: NOITEM_TITLE_LR_PADDING_SIZE_INC -1; + fixed: 1 1; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.0; to: "bg"; } + } + } + part { name: "title_bottom_padding"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 NOITEM_TITLE_BOTTOM_PADDING_SIZE_INC; + max: -1 NOITEM_TITLE_BOTTOM_PADDING_SIZE_INC; + fixed: 0 1; + align: 0.0 0.0; + rel1 {relative: 0.0 1.0; to: "elm.text.title"; } + rel2 {relative: 1.0 1.0; to: "elm.text.title"; } + } + } + part { name: "elm.text.title"; + type: TEXTBLOCK; + scale: 1; + description { state: "default" 0.0; + min: 0 NOITEM_TITLE_TEXT_HEIGHT_INC; + max: -1 NOITEM_TITLE_TEXT_HEIGHT_INC; + fixed: 1 1; + text { + min: 0 1; + align: 0.5 0.5; + style: "nocontent_title_style"; + } + align: 0.0 0.0; + rel1 { relative: 1.0 1.0; to_x: "left_padding"; to_y: "title_top_padding"; } + rel2 { relative: 0.0 1.0; to_x: "right_padding"; to_y: "title_top_padding"; } + } + } + part { + name: "left_padding"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: NOITEM_TEXT_LR_PADDING_SIZE_INC 0; + max: NOITEM_TEXT_LR_PADDING_SIZE_INC -1; + fixed: 1 1; + align: 0.0 0.0; + rel1 { + to: "bg"; + relative: 0.0 0.0; + } + rel2 { + to: "bg"; + relative: 0.0 0.0; + } + } + } + part { + name: "right_padding"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + min: NOITEM_TEXT_LR_PADDING_SIZE_INC 0; + max: NOITEM_TEXT_LR_PADDING_SIZE_INC -1; + fixed: 1 1; + align: 1.0 0.0; + rel1 { + to: "bg"; + relative: 1.0 0.0; + } + rel2 { + to: "bg"; + relative: 1.0 0.0; + } + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + clip_to: "icon_clip"; + description { state: "default" 0.0; + min: NOITEM_IMAGE_SIZE_INC NOITEM_IMAGE_SIZE_INC; + max: NOITEM_IMAGE_SIZE_INC NOITEM_IMAGE_SIZE_INC; + //color: 255 255 255 255; + rel1{ + to: "title_bottom_padding"; + relative: 0.0 1.0; + } + rel2 { + to: "title_bottom_padding"; + relative: 1.0 1.0; + } + fixed: 0 1; + align: 0.5 0.0; + } + } + part { name: "icon_clip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + rel1.to: "elm.swallow.icon"; + rel2.to: "elm.swallow.icon"; + color: 255 255 255 255; + } + } + part { name: "image_bottom_padding"; + type: SPACER; + scale: 1; + description { state: "default" 0.0; + min: 0 NOITEM_IMAGE_PADDING_HEIGHT_INC; + max: -1 NOITEM_IMAGE_PADDING_HEIGHT_INC; + rel1 { + to: "elm.swallow.icon"; + relative: 0.0 1.0; + } + rel2 { + to: "elm.swallow.icon"; + relative: 1.0 1.0; + } + fixed: 0 1; + align: 0.5 0.0; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + description { state: "default" 0.0; + fixed: 1 1; + min: 0 NOITEM_TEXT_SIZE_INC; + max: -1 NOITEM_TEXT_SIZE_INC; + rel1 { + to_x: "left_padding"; + to_y: "image_bottom_padding"; + relative: 1.0 1.0; + } + rel2 { + to_x: "right_padding"; + to_y: "image_bottom_padding"; + relative: 0.0 1.0; + } + align: 0.5 0.0; + text { + style: "nocontent_style"; + min: 0 1; + max: 0 1; + } + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + } + } + } + } +} \ No newline at end of file diff --git a/src/App/src/MainLayout.cpp b/src/App/src/MainLayout.cpp index 70e574b..ed34d8c 100644 --- a/src/App/src/MainLayout.cpp +++ b/src/App/src/MainLayout.cpp @@ -65,13 +65,11 @@ void MainLayout::prepareNoContents() if (m_pNoContent) return; - m_pNoContent = elm_layout_add(getEo()); - elm_layout_theme_set(m_pNoContent, "layout", "nocontents", "text"); + m_pNoContent = View::addLayout(getEo(), NO_CONTENT_LAYOUT_EDJ, "no_content"); Evas_Object *icon = View::addLayout(m_pNoContent, ICONS_EDJ, "no_recipient_icon"); elm_object_part_content_set(m_pNoContent, "elm.swallow.icon", icon); elm_object_part_text_set(m_pNoContent, "elm.text.title", msg("WDS_ST_OPT_RECENT_APPS_ABB").cStr()); elm_object_part_text_set(m_pNoContent, "elm.text", msg("IDS_AT_BODY_NO_RECENT_APPS").cStr()); - emitSignal(m_pNoContent, "elm,state,title,enable", "elm"); setContent(m_pNoContent, "swl.bg"); } -- 2.7.4