[Implementation] Implemented button style with circle effect for arbitrary image.
Updated basic button implementation. Fixed custom button performance issue.
Change-Id: Ibb942152745330d0e313d7243414eabf26421515
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
#include "AppsCommonPath.h"
-#define APPS_COMMON_BUTTONS_EDJ APPS_COMMON_EDJ_DIR"apps-common-buttons.edj"
+#define APPS_COMMON_BUTTONS_EDJ APPS_COMMON_EDJ_DIR"apps-common-buttons.edj"
-#define STYLE_BUTTON_CUSTOM_DEFAULT "custom_default"
-#define STYLE_BUTTON_CUSTOM_SMALL "custom_small"
-#define STYLE_BUTTON_CUSTOM_CIRCLE "custom_circle"
+#define STYLE_BUTTON_CUSTOM_DEFAULT "custom_default"
+#define STYLE_BUTTON_CUSTOM_SMALL "custom_small"
+#define STYLE_BUTTON_CUSTOM_CIRCLE "custom_circle"
+#define STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG "custom_circle/no_bg"
-#define BUTTON_TEXT_CLASS "button_text"
-#define BUTTON_COLOR_CLASS_NORMAL "button_normal"
+#define BUTTON_TEXT_CLASS "button_text"
+#define BUTTON_COLOR_CLASS_NORMAL "button_normal"
+#define BUTTON_COLOR_CLASS_PRESSED "button_pressed"
+#define BUTTON_COLOR_CLASS_UNPRESSED "button_unpressed"
+#define BUTTON_COLOR_CLASS_ICON_NORMAL "button_icon_normal"
+#define BUTTON_COLOR_CLASS_ICON_PRESSED "button_icon_pressed"
#endif /* APPS_COMMON_BUTTONS_H */
*
*/
-#include "apps-common-colors.edc"
+#include "AppsCommonButtons.h"
#include "apps-common-utils.edc"
-#define BUTTON_CORNER_RADIUS "35"
+#define BUTTON_CORNER_RADIUS "39"
#define BUTTON_DEFAULT_H 78
-#define BUTTON_DEFAULT_TEXT_H 54
-#define BUTTON_DEFAULT_TEXT_LR 20
-#define BUTTON_DEFAULT_TEXT_TB ((BUTTON_DEFAULT_H-BUTTON_DEFAULT_TEXT_H)/2)
+#define BUTTON_DEFAULT_TEXT_LR 32
#define BUTTON_SMALL_CORNER_RADIUS "25"
#define BUTTOM_SMALL_H 50
#define BUTTON_SMALL_TEXT_LR 24
-#define BUTTON_SMALL_TEXT_TB 2
-#define BUTTON_SMALL_TEXT_H (BUTTOM_SMALL_H-(BUTTON_SMALL_TEXT_TB*2))
#define BUTTON_CIRCLE_WH 98
#define BUTTON_CIRCLE_CONTENT_WH 60
+#define BUTTON_CIRCLE_NO_BG_WH 80
styles {
style {
name: "button_main";
- base: "font=Tizen:style=Light font_size=40 align=center color=#ffffffff text_class="BUTTON_TEXT_CLASS;
+ base: "font=Tizen:style=Light font_size=40 align=center color=#fafafa text_class="BUTTON_TEXT_CLASS;
+ }
+}
+
+color_classes {
+ color_class {
+ name: BUTTON_COLOR_CLASS_NORMAL;
+ color: 82 198 216 255;
+ }
+ color_class {
+ name: BUTTON_COLOR_CLASS_PRESSED;
+ color: 0 0 0 77;
+ }
+ color_class {
+ name: BUTTON_COLOR_CLASS_UNPRESSED;
+ color: 0 0 0 0;
+ }
+ color_class {
+ name: BUTTON_COLOR_CLASS_ICON_NORMAL;
+ color: 250 250 250 255;
+ }
+ color_class {
+ name: BUTTON_COLOR_CLASS_ICON_PRESSED;
+ color: 250 250 250 255;
}
}
collections {
base_scale: 2.6;
+ plugins {
+ plugin {
+ name: "touch_sound";
+ source: "feedback";
+ param: "FEEDBACK_TYPE_SOUND FEEDBACK_PATTERN_TAP";
+ }
+ }
+
group { "elm/button/base/custom";
script {
FUNCTION_SCALE_PART
+ public effect_scale;
}
parts {
swallow { "tizen_vg_shape"; scale;
}
rect { "rect.bg"; scale;
desc { "default";
+ rel1.to: "tizen_vg_shape";
+ rel2.to: "tizen_vg_shape";
color_class: BUTTON_COLOR_CLASS_NORMAL;
}
}
}
rect { "rect.effect_bg"; scale;
desc { "default";
- color: 0 0 0 0;
+ rel1.to: "tizen_vg_shape2";
+ rel2.to: "tizen_vg_shape2";
+ color_class: BUTTON_COLOR_CLASS_UNPRESSED;
}
desc { "pressed";
- color: 0 0 0 77;
+ rel1.to: "tizen_vg_shape2";
+ rel2.to: "tizen_vg_shape2";
+ color_class: BUTTON_COLOR_CLASS_PRESSED;
}
}
}
programs {
program {
+ name: "loaded";
+ signal: "load";
+ source: "*";
+ script {
+ set_float(effect_scale, 0.7);
+ }
+ }
+ program {
name: "pressed";
signal: "mouse,down,*";
source: "*";
script {
- scale_part(PART:"tizen_vg_shape2", "default", 0.7);
+ scale_part(PART:"tizen_vg_shape2", "default", get_float(effect_scale));
set_state(PART:"rect.effect_bg", "pressed", 0.0);
}
after: "pressed_effect";
}
program {
+ name: "unpressed";
+ signal: "mouse,up,*";
+ source: "*";
+ script {
+ new r, g, b, a;
+ get_color_class(BUTTON_COLOR_CLASS_PRESSED, r, g, b, a);
+ set_color_class(BUTTON_COLOR_CLASS_UNPRESSED, r, g, b, 0);
+ }
+ after: "unpressed_effect";
+ }
+ program {
name: "pressed_effect";
action: STATE_SET "default" 0.0;
target: "tizen_vg_shape2";
transition: TRANSITION_GLIDE(0.15);
}
program {
- name: "unpressed";
- signal: "mouse,up,*";
- source: "*";
+ name: "unpressed_effect";
action: STATE_SET "default" 0.0;
target: "rect.effect_bg";
transition: TRANSITION_GLIDE(0.45);
}
program {
+ name: "touch_sound";
+ signal: "mouse,clicked,*";
+ source: "*";
+ action: RUN_PLUGIN "touch_sound";
+ }
+ program {
name: "clicked";
signal: "mouse,clicked,*";
source: "*";
data.item: "corner_radius" BUTTON_CORNER_RADIUS;
parts {
- spacer { "spacer.left_top"; scale;
+ spacer { "spacer.base"; scale;
desc { "default";
- min: BUTTON_DEFAULT_TEXT_LR BUTTON_DEFAULT_TEXT_TB;
- align: 0.0 0.0;
+ min: 0 BUTTON_DEFAULT_H;
+ }
+ }
+ spacer { "spacer.left"; scale;
+ desc { "default";
+ fixed: 1 0;
+ min: BUTTON_DEFAULT_TEXT_LR 0;
+ align: 0.0 0.5;
rel1.relative: 0.0 0.0;
- rel2.relative: 0.0 0.0;
+ rel2.relative: 0.0 1.0;
}
}
- spacer { "spacer.right_bottom"; scale;
+ spacer { "spacer.right"; scale;
desc { "default";
- min: BUTTON_DEFAULT_TEXT_LR BUTTON_DEFAULT_TEXT_TB;
- align: 1.0 1.0;
- rel1.relative: 1.0 1.0;
+ fixed: 1 0;
+ min: BUTTON_DEFAULT_TEXT_LR 0;
+ align: 1.0 0.5;
+ rel1.relative: 1.0 0.0;
rel2.relative: 1.0 1.0;
}
}
textblock { "elm.text"; scale;
desc { "default";
- min: 0 BUTTON_DEFAULT_TEXT_H;
- rel1 { relative: 1.0 1.0; to: "spacer.left_top"; }
- rel2 { relative: 0.0 0.0; to: "spacer.right_bottom"; }
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.0; to_x: "spacer.left"; }
+ rel2 { relative: 0.0 1.0; to_x: "spacer.right"; }
text {
+ align: 0.5 0.5;
style: "button_main";
- min: 1 0;
- ellipsis: -1;
}
}
}
data.item: "corner_radius" BUTTON_SMALL_CORNER_RADIUS;
parts {
- spacer { "spacer.left_top"; scale;
+ spacer { "spacer.base"; scale;
desc { "default";
- min: BUTTON_SMALL_TEXT_LR BUTTON_SMALL_TEXT_TB;
+ min: 0 BUTTOM_SMALL_H;
}
}
- spacer { "spacer.right_bottom"; scale;
+ spacer { "spacer.left"; scale;
desc { "default";
- min: BUTTON_SMALL_TEXT_LR BUTTON_SMALL_TEXT_TB;
+ min: BUTTON_SMALL_TEXT_LR 0;
}
}
- textblock { "elm.text"; scale;
+ spacer { "spacer.right"; scale;
desc { "default";
- min: 0 BUTTON_SMALL_TEXT_H;
+ min: BUTTON_SMALL_TEXT_LR 0;
}
}
}
}
}
swallow { "elm.swallow.content"; scale;
+ clip_to: "rect.icon_bg";
desc { "default";
fixed: 1 1;
min: BUTTON_CIRCLE_CONTENT_WH BUTTON_CIRCLE_CONTENT_WH;
rel2.relative: 0.5 0.5;
}
}
+ rect { "rect.icon_bg"; scale;
+ desc { "default";
+ color_class: BUTTON_COLOR_CLASS_ICON_NORMAL;
+ }
+ desc { "pressed";
+ color_class: BUTTON_COLOR_CLASS_ICON_PRESSED;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "icon_pressed";
+ signal: "mouse,down,*";
+ source: "*";
+ action: STATE_SET "pressed" 0.0;
+ target: "rect.icon_bg";
+ }
+ program {
+ name: "icon_unpressed";
+ signal: "mouse,up,*";
+ source: "*";
+ action: STATE_SET "default" 0.0;
+ target: "rect.icon_bg";
+ transition: TRANSITION_GLIDE(0.45);
+ }
+ }
+ }
+
+ group { "elm/button/base/"STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG;
+ inherit: "elm/button/base/"STYLE_BUTTON_CUSTOM_CIRCLE;
+ data.item: "vector_ux" "circle";
+
+ parts {
+ spacer { "spacer.base"; scale;
+ desc { "default";
+ min: BUTTON_CIRCLE_NO_BG_WH BUTTON_CIRCLE_NO_BG_WH;
+ }
+ }
+ swallow { "tizen_vg_shape2"; scale;
+ desc { "default";
+ rel1.relative: -0.15 -0.15;
+ rel2.relative: 1.15 1.15;
+ }
+ }
+ swallow { "elm.swallow.content"; scale;
+ desc { "default";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "loaded";
+ signal: "load";
+ source: "*";
+ script {
+ set_float(effect_scale, 1.0);
+ set_color_class(BUTTON_COLOR_CLASS_NORMAL, 0, 0, 0, 0);
+ set_color_class(BUTTON_COLOR_CLASS_PRESSED, 61, 185, 204, 77);
+ set_color_class(BUTTON_COLOR_CLASS_ICON_NORMAL, 61, 185, 204, 255);
+ set_color_class(BUTTON_COLOR_CLASS_ICON_PRESSED, 34, 104, 115, 255);
+ }
+ }
}
}
}
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 "AppsCommonButtons.h"
-
-color_classes {
- color_class { //A03O003
- name: "thumbnail_bg";
- color: 255 255 255 255;
- }
- color_class { //A03O003L1
- name: "thumbnail_default";
- color: 61 185 204 128;
- }
- color_class {
- name: BUTTON_COLOR_CLASS_NORMAL;
- color: 82 198 216 255;
- }
- color_class { //W023 (Input Color 1)
- name: "icon_expand";
- color: 61 185 204 255;
- }
- color_class { //W0113 (Input Color 1)
- name: "touch_icon_normal";
- color: 61 185 204 255;
- }
- color_class { //W0113P
- name: "touch_icon_pressed";
- color: 34 104 115 255;
- }
-}
*/
#include "AppsCommonThumbnail.h"
-#include "apps-common-colors.edc"
#include "apps-common-utils.edc"
+color_classes {
+ color_class { //A03O003
+ name: "thumbnail_bg";
+ color: 255 255 255 255;
+ }
+ color_class { //A03O003L1
+ name: "thumbnail_default";
+ color: 61 185 204 128;
+ }
+}
+
collections {
IMAGE_WITH_MASK(LAYOUT_THUMBNAIL_SMALL, THUMBNAIL_MASK_SMALL)
IMAGE_WITH_MASK(LAYOUT_THUMBNAIL_MEDIUM, THUMBNAIL_MASK_MEDIUM)
set(EDCFILES details-item-layout.edc)
set(EDJDIR "${RES_DIR}/details/edje")
+set(IMGDIR "${RES_DIR}/details/images")
foreach(EDCFILE ${EDCFILES})
get_filename_component(EDJFILE ${EDCFILE} NAME_WE)
add_dependencies(${PROJECT_NAME} ${EDJFILE})
install(FILES ${EDJFILE} DESTINATION ${EDJDIR})
endforeach(${EDCFILE})
+
+install(DIRECTORY images/ DESTINATION ${IMGDIR})
#ifndef DETAILS_ITEM_LAYOUT_METRICS_H
#define DETAILS_ITEM_LAYOUT_METRICS_H
-#define ACTION_BTN_WH 80
-
#define THUMBNAIL_WH 270
#define THUMBNAIL_T 60
#define THUMBNAIL_B 110
*
*/
-#ifndef CONTACTS_DETAILS_PATH_H
-#define CONTACTS_DETAILS_PATH_H
+#ifndef DETAILS_PATH_H
+#define DETAILS_PATH_H
#define DETAILS_IMG_DIR "details/images/"
#define DETAILS_EDJ_DIR "details/edje/"
-#define CONTACTS_DETAILS_ITEM_LAYOUT_EDJ DETAILS_EDJ_DIR"contacts-details-item-layout.edj"
+#define DETAILS_ITEM_LAYOUT_EDJ DETAILS_EDJ_DIR"details-item-layout.edj"
#define DETAILS_ICON_CALL DETAILS_IMG_DIR"contacts_btn_ic_call.png"
#define DETAILS_ICON_MESSAGE DETAILS_IMG_DIR"contacts_btn_ic_message.png"
#define DETAILS_ICON_EMAIL DETAILS_IMG_DIR"contacts_btn_ic_email.png"
#define DETAILS_ICON_INTERNET DETAILS_IMG_DIR"contacts_btn_ic_Internet.png"
-#endif /* CONTACTS_DETAILS_PATH_H */
+#endif /* DETAILS_PATH_H */
#include "DetailsItemLayout.h"
#include "DetailsItemLayoutMetrics.h"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-colors.edc"
collections
{
USER_INC_FILES =
USER_INC_FILES_ABS =
## C++ Compiler
-USER_CPP_INC_DIRS = inc res/details/edje res/input/edje res/list/edje res/groups/edje
+USER_CPP_INC_DIRS = inc res/input/edje res/list/edje res/groups/edje
USER_CPP_INC_DIRS_ABS = $(workspace_loc)/lib-apps-common/inc $(workspace_loc)/lib-apps-common/res/apps-common/edje $(workspace_loc)/lib-common/inc $(workspace_loc)/lib-common/res/details/edje
USER_CPP_INC_FILES =
USER_CPP_INC_FILES_ABS =
# EDC Flags
USER_EXT_EDC_KEYS = EDC0
-USER_EXT_EDC0_EDCS = res/details/edje/contacts-details-item-layout.edc res/input/edje/input-item-layout.edc
+USER_EXT_EDC0_EDCS = res/input/edje/input-item-layout.edc
USER_EXT_EDC0_EDCS_IMAGE_DIRS = res
USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
# Resource Filter
USER_RES_INCLUDE =
-USER_RES_EXCLUDE = res/details/CMakeLists.txt res/input/CMakeLists.txt res/list/CMakeLists.txt res/CMakeLists.txt
+USER_RES_EXCLUDE = res/input/CMakeLists.txt res/list/CMakeLists.txt res/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
-add_subdirectory(details)
add_subdirectory(groups)
add_subdirectory(input)
add_subdirectory(list)
+++ /dev/null
-set(EDC_FILES contacts-details-item-layout.edc)
-set(EDJ_DIR "${RES_DIR}/details/edje")
-set(IMG_DIR "${RES_DIR}/details/images")
-
-foreach(EDC_FILE ${EDC_FILES})
- get_filename_component(EDJ_FILE ${EDC_FILE} NAME_WE)
- set(EDJ_FILE ${EDJ_FILE}.edj)
-
- add_custom_target(${EDJ_FILE}
- COMMAND edje_cc -id .. edje/${EDC_FILE} ${EDJ_FILE}
- DEPENDS edje/${EDC_FILE}
- )
-
- add_dependencies(${PROJECT_NAME} ${EDJ_FILE})
- install(FILES ${EDJ_FILE} DESTINATION ${EDJ_DIR})
-endforeach(${EDC_FILE})
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 CONTACTS_DETAILS_ITEM_LAYOUT_H
-#define CONTACTS_DETAILS_ITEM_LAYOUT_H
-
-#include "ContactsDetailsPath.h"
-
-#define GROUP_ICON_CALL "icon_call"
-#define GROUP_ICON_MESSAGE "icon_message"
-#define GROUP_ICON_EMAIL "icon_email"
-#define GROUP_ICON_INTERNET "icon_internet"
-
-#endif /* CONTACTS_DETAILS_ITEM_LAYOUT_H */
+++ /dev/null
-/*
- * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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 "ContactsDetailsItemLayout.h"
-
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
-#include "../../../../lib-common/res/details/edje/details-item-layout.edc"
-
-collections
-{
- base_scale: 2.6;
-
- IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_CALL, DETAILS_ICON_CALL,
- "touch_icon_normal", "touch_icon_pressed");
- IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_MESSAGE, DETAILS_ICON_MESSAGE,
- "touch_icon_normal", "touch_icon_pressed");
- IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_EMAIL, DETAILS_ICON_EMAIL,
- "touch_icon_normal", "touch_icon_pressed");
- IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_INTERNET, DETAILS_ICON_INTERNET,
- "touch_icon_normal", "touch_icon_pressed");
-}
#define PART_BUTTON "swallow.button"
#define PART_REL_ICON "swallow.rel_icon"
-#define GROUP_ICON_EXPAND "icon_expand"
-#define GROUP_ICON_CONTRACT "icon_contract"
-#define GROUP_ICON_RELATIONSHIP "icon_relationship"
-
#endif /* INPUT_ITEM_LAYOUT_H */
#ifndef INPUT_ITEM_LAYOUT_METRICS_H
#define INPUT_ITEM_LAYOUT_METRICS_H
-#define ITEM_H 120
-#define ITEM_T 33
-#define ITEM_B 20
-
#define TYPE_L 32
+#define TYPE_B 20
#define TYPE_W 180
-
#define BUTTON_R 10
-#define BUTTON_WH 80
#define IMAGE_TB 60
#define IMAGE_WH 270
#include "InputItemLayout.h"
#include "InputItemLayoutMetrics.h"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-colors.edc"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
-
collections
{
base_scale: 2.6;
- IMAGE_WITH_COLOR(GROUP_ICON_EXPAND, INPUT_ICON_EXPAND, "icon_expand")
- IMAGE_WITH_COLOR(GROUP_ICON_CONTRACT, INPUT_ICON_CONTRACT, "icon_expand")
- IMAGE_WITH_COLOR_AND_TOUCH(GROUP_ICON_RELATIONSHIP, INPUT_ICON_RELATIONSHIP,
- "touch_icon_normal", "touch_icon_pressed");
-
group {
name: "elm/genlist/item/"INPUT_ITEM_STYLE"/default";
alias: "elm/genlist/item_compress/"INPUT_ITEM_STYLE"/default";
parts {
swallow { "swallow.bg"; }
- spacer { "spacer.left_top"; scale;
+ spacer { "spacer.left_bottom"; scale;
desc { "default";
- align: 0.0 0.0;
- rel1.relative: 0.0 0.0;
- rel2.relative: 0.0 0.0;
+ align: 0.0 1.0;
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 0.0 1.0;
}
desc { "visible";
inherit: "default";
- min: TYPE_L ITEM_T;
+ min: TYPE_L TYPE_B;
}
}
swallow { PART_TYPE; scale;
desc { "default";
- align: 0.0 0.5;
- rel1 { relative: 1.0 1.0; to: "spacer.left_top"; }
- rel2 { relative: 1.0 0.0; to_x: "spacer.left_top"; to_y: "spacer.right_bottom"; }
+ align: 0.0 1.0;
+ rel1 { relative: 1.0 0.0; to: "spacer.left_bottom"; }
+ rel2 { relative: 1.0 0.0; to: "spacer.left_bottom"; }
}
desc { "visible";
inherit: "default";
swallow { PART_BUTTON; scale;
desc { "default";
align: 1.0 0.5;
- rel1 { relative: 0.0 0.5; to_x: "spacer.right_bottom"; }
- rel2 { relative: 0.0 0.5; to_x: "spacer.right_bottom"; }
+ rel1 { relative: 0.0 0.0; to_x: "spacer.right"; }
+ rel2 { relative: 0.0 1.0; to_x: "spacer.right"; }
}
}
- spacer { "spacer.right_bottom"; scale;
+ spacer { "spacer.right"; scale;
desc { "default";
- align: 1.0 1.0;
- min: BUTTON_R ITEM_B;
- rel1.relative: 1.0 1.0;
+ align: 1.0 0.5;
+ min: BUTTON_R 0;
+ rel1.relative: 1.0 0.0;
rel2.relative: 1.0 1.0;
}
}
source: "elm";
action: STATE_SET "visible" 0.0;
target: PART_TYPE;
- target: "spacer.left_top";
+ target: "spacer.left_bottom";
}
program {
signal: "elm,state,"PART_TYPE",passive";
source: "elm";
action: STATE_SET "default" 0.0;
target: PART_TYPE;
- target: "spacer.left_top";
+ target: "spacer.left_bottom";
}
}
}
swallow { PART_REL_ICON; scale;
desc { "default";
align: 1.0 0.5;
- min: BUTTON_WH BUTTON_WH;
- rel1 { relative: 0.0 0.5; to_x: PART_BUTTON; }
- rel2 { relative: 0.0 0.5; to_x: PART_BUTTON; }
+ rel1 { relative: 0.0 0.0; to_x: PART_BUTTON; }
+ rel2 { relative: 0.0 1.0; to_x: PART_BUTTON; }
}
}
}
#include "Ui/Scale.h"
#include "Utils/Callback.h"
-#include "ContactsDetailsItemLayout.h"
-#include "DetailsItemLayoutMetrics.h"
+#include "AppsCommonButtons.h"
+#include "DetailsPath.h"
#define PART_ACTION_BUTTON1 "elm.swallow.icon.2"
#define PART_ACTION_BUTTON2 "elm.swallow.end"
using namespace Contacts::Details;
using namespace Contacts::Model;
-namespace
-{
- const std::string layoutPath = App::getResourcePath(CONTACTS_DETAILS_ITEM_LAYOUT_EDJ);
-}
-
ActionFieldItem::ActionFieldItem(Model::ContactObject &object, ActionType actionType)
: FieldItem(object), m_ActionType(actionType)
{
Evas_Object *ActionFieldItem::createActionButton(Evas_Object *parent, ActionType actionType)
{
- static const int imageSize = Ui::getScaledValue(ACTION_BTN_WH);
static const char *icons[] = {
- /* ActionCall = */ GROUP_ICON_CALL,
- /* ActionMessage = */ GROUP_ICON_MESSAGE,
- /* ActionEmail = */ GROUP_ICON_EMAIL,
- /* ActionUrl = */ GROUP_ICON_INTERNET
+ /* ActionCall = */ DETAILS_ICON_CALL,
+ /* ActionMessage = */ DETAILS_ICON_MESSAGE,
+ /* ActionEmail = */ DETAILS_ICON_EMAIL,
+ /* ActionUrl = */ DETAILS_ICON_INTERNET
};
- Evas_Object *image = elm_image_add(parent);
- elm_image_file_set(image, layoutPath.c_str(), icons[actionType]);
- evas_object_size_hint_min_set(image, imageSize, imageSize);
- evas_object_propagate_events_set(image, EINA_FALSE);
- evas_object_smart_data_set(image, (void *) actionType);
- evas_object_smart_callback_add(image, "clicked",
+ Evas_Object *button = elm_button_add(parent);
+ elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
+ evas_object_propagate_events_set(button, EINA_FALSE);
+ evas_object_smart_data_set(button, (void *) actionType);
+ evas_object_smart_callback_add(button, "clicked",
makeCallback(&ActionFieldItem::onButtonPressed), this);
- return image;
+ Evas_Object *image = elm_image_add(button);
+ elm_image_file_set(image, App::getResourcePath(icons[actionType]).c_str(), nullptr);
+ elm_object_part_content_set(button, "elm.swallow.content", image);
+
+ return button;
}
void ActionFieldItem::executeAction(ActionType actionType)
#include "Utils/Logger.h"
#include "Utils/Range.h"
-#include "ContactsDetailsPath.h"
+#include "DetailsPath.h"
#include <app_i18n.h>
Evas_Object *DetailsView::onCreate(Evas_Object *parent)
{
- elm_theme_extension_add(nullptr, App::getResourcePath(CONTACTS_DETAILS_ITEM_LAYOUT_EDJ).c_str());
+ elm_theme_extension_add(nullptr, App::getResourcePath(DETAILS_ITEM_LAYOUT_EDJ).c_str());
m_Genlist = new Ui::Genlist();
m_Genlist->create(parent);
#include "App/Path.h"
#include "Utils/Callback.h"
+#include "AppsCommonButtons.h"
#include "InputItemLayout.h"
using namespace Contacts::Input;
using namespace Contacts::Model;
-namespace
-{
- const std::string layoutPath = App::getResourcePath(INPUT_ITEM_LAYOUT_EDJ);
-}
-
ContactCompoundFieldItem::ContactCompoundFieldItem(Model::ContactObject &object)
: ContactFieldItem(object)
{
Evas_Object *ContactCompoundFieldItem::createExpandButton(Evas_Object *parent)
{
Evas_Object *button = elm_button_add(parent);
- /* FIXME: Request standard style for expand open/close buttons */
- elm_object_style_set(button, "floatingbutton/default");
+ elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
elm_object_focus_allow_set(button, EINA_FALSE);
evas_object_smart_callback_add(button, "clicked",
makeCallback(&ContactCompoundFieldItem::onExpandPressed), this);
+ std::string path = App::getResourcePath(isExpanded() ? INPUT_ICON_CONTRACT : INPUT_ICON_EXPAND);
Evas_Object *icon = elm_image_add(button);
elm_object_part_content_set(button, "elm.swallow.content", icon);
- elm_image_file_set(icon, layoutPath.c_str(),
- isExpanded() ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
+ elm_image_file_set(icon, path.c_str(), nullptr);
return button;
}
void ContactCompoundFieldItem::updateExpandIcon(bool isExpanded) const
{
+ std::string path = App::getResourcePath(isExpanded ? INPUT_ICON_CONTRACT : INPUT_ICON_EXPAND);
Evas_Object *button = elm_object_item_part_content_get(getObjectItem(), PART_BUTTON);
Evas_Object *icon = elm_object_part_content_get(button, "elm.swallow.content");
- elm_image_file_set(icon, layoutPath.c_str(),
- isExpanded ? GROUP_ICON_CONTRACT : GROUP_ICON_EXPAND);
+ elm_image_file_set(icon, path.c_str(), nullptr);
}
void ContactCompoundFieldItem::onExpandPressed(Evas_Object *button, void *eventInfo)
#include "Utils/Callback.h"
#include "Utils/Logger.h"
+#include "AppsCommonButtons.h"
#include "InputItemLayout.h"
using namespace Contacts::Input;
using namespace Contacts::Model;
-namespace
-{
- const std::string layoutPath = App::getResourcePath(INPUT_ITEM_LAYOUT_EDJ);
-}
-
Elm_Genlist_Item_Class *ContactRelationshipFieldItem::getItemClass() const
{
static Elm_Genlist_Item_Class itc = createItemClass(INPUT_REL_ITEM_STYLE);
Evas_Object *ContactRelationshipFieldItem::getContent(Evas_Object *parent, const char *part)
{
if (strcmp(part, PART_REL_ICON) == 0) {
- Evas_Object *button = elm_image_add(parent);
- elm_image_file_set(button, layoutPath.c_str(), GROUP_ICON_RELATIONSHIP);
+ Evas_Object *button = elm_button_add(parent);
+ elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
evas_object_smart_callback_add(button, "clicked",
makeCallback(&ContactRelationshipFieldItem::onPickPressed), this);
+
+ Evas_Object *image = elm_image_add(button);
+ elm_image_file_set(image, App::getResourcePath(INPUT_ICON_RELATIONSHIP).c_str(), nullptr);
+ elm_object_part_content_set(button, "elm.swallow.content", image);
+
return button;
}
set(EDC_FILES logs-details-item-layout.edc)
set(EDJ_DIR "${RES_DIR}/details/edje")
-set(IMG_DIR "${RES_DIR}/details/images")
foreach(EDC_FILE ${EDC_FILES})
get_filename_component(EDJ_FILE ${EDC_FILE} NAME_WE)
add_dependencies(${PROJECT_NAME} ${EDJ_FILE})
install(FILES ${EDJ_FILE} DESTINATION ${EDJ_DIR})
endforeach(${EDC_FILE})
-
-install(DIRECTORY images/ DESTINATION ${IMG_DIR})
#define LOGS_DETAILS_ITEM_LAYOUT_EDJ DETAILS_EDJ_DIR"logs-details-item-layout.edj"
-#define DETAILS_ICON_CALL DETAILS_IMG_DIR"logs_btn_ic_call.png"
-#define DETAILS_ICON_MESSAGE DETAILS_IMG_DIR"logs_btn_ic_message.png"
-
#endif /* LOGS_DETAILS_PATH_H */
#include "LogsDetailsItemLayout.h"
-#include "../../../../lib-apps-common/res/apps-common/edje/apps-common-utils.edc"
#include "../../../../lib-common/res/details/edje/details-item-layout.edc"
#define UNSAVED_BTN_H 78
{
base_scale: 2.6;
- IMAGE_WITH_COLOR_AND_TOUCH(LAYOUT_ICON_CALL, DETAILS_ICON_CALL,
- "touch_icon_normal", "touch_icon_pressed");
- IMAGE_WITH_COLOR_AND_TOUCH(LAYOUT_ICON_MESSAGE, DETAILS_ICON_MESSAGE,
- "touch_icon_normal", "touch_icon_pressed");
-
group {
name: "elm/genlist/item/"LOGS_DETAILS_ITEM_STYLE"/default";
alias: "elm/genlist/item_compress/"LOGS_DETAILS_ITEM_STYLE"/default";
#include "Logs/Details/ActionItem.h"
#include "Logs/Model/Log.h"
-#include "LogsDetailsItemLayout.h"
-#include "DetailsItemLayoutMetrics.h"
-
#include "App/Path.h"
#include "Ui/Menu.h"
#include "Ui/Scale.h"
#include "Utils/Callback.h"
#include "Common/Strings.h"
+#include "AppsCommonButtons.h"
+#include "DetailsPath.h"
+
#include <app_i18n.h>
using namespace Logs::Details;
#define TAG_BACKING "<backing=on><backing_color=#00ddff99>"
-namespace
-{
- const std::string layoutPath = App::getResourcePath(LOGS_DETAILS_ITEM_LAYOUT_EDJ);
-}
ActionItem::ActionItem(LogGroup *group)
: m_Group(group)
Evas_Object *ActionItem::createActionButton(Evas_Object *parent, ActionType actionType)
{
- static const int imageSize = Ui::getScaledValue(ACTION_BTN_WH);
static const char *actionIcons[] = {
- /* ActionCall = */ LAYOUT_ICON_CALL,
- /* ActionMessage = */ LAYOUT_ICON_MESSAGE
+ /* ActionCall = */ DETAILS_ICON_CALL,
+ /* ActionMessage = */ DETAILS_ICON_MESSAGE
};
- Evas_Object *image = elm_image_add(parent);
- elm_image_file_set(image, layoutPath.c_str(), actionIcons[actionType]);
- evas_object_size_hint_min_set(image, imageSize, imageSize);
- evas_object_propagate_events_set(image, EINA_FALSE);
- evas_object_smart_data_set(image, (void *) actionType);
- evas_object_smart_callback_add(image, "clicked",
+ Evas_Object *button = elm_button_add(parent);
+ elm_object_style_set(button, STYLE_BUTTON_CUSTOM_CIRCLE_NO_BG);
+ evas_object_propagate_events_set(button, EINA_FALSE);
+ evas_object_smart_data_set(button, (void *) actionType);
+ evas_object_smart_callback_add(button, "clicked",
makeCallback(&ActionItem::onButtonPressed), this);
- return image;
+ Evas_Object *image = elm_image_add(button);
+ elm_image_file_set(image, App::getResourcePath(actionIcons[actionType]).c_str(), nullptr);
+ elm_object_part_content_set(button, "elm.swallow.content", image);
+
+ return button;
}
void ActionItem::executeAction(ActionType actionType)