From 936c23e587c16093e89bbdf5a673ba9dc989acac Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Tue, 12 May 2020 11:16:19 +0900 Subject: [PATCH] Modify the genlist icon type for common profile Change-Id: I5fd43118dc6b0b3a250b959b999b7b63921ab621 Signed-off-by: DoHyun Pyun --- common/include/bt-widget.h | 4 +- common/src/ui/bt-main-view.c | 50 +++++++-- common/src/ui/bt-profile-view.c | 8 +- data/theme_2.3/bluetooth_genlist.edc | 200 +++++++++++++++++++++++++++++++++++ 4 files changed, 245 insertions(+), 17 deletions(-) diff --git a/common/include/bt-widget.h b/common/include/bt-widget.h index 91e0434..9236b70 100644 --- a/common/include/bt-widget.h +++ b/common/include/bt-widget.h @@ -51,8 +51,8 @@ static inline char* get_genlist_style(bt_genlist_type_t type) #define BT_GENLIST_1LINE_TEXT_STYLE get_genlist_style(BT_GENLIST_1LINE) #define BT_GENLIST_1LINE_TEXT_ICON_STYLE get_genlist_style(BT_GENLIST_1LINE) -#define BT_GENLIST_2LINE_TOP_TEXT_STYLE get_genlist_style(BT_GENLIST_2LINE) -#define BT_GENLIST_2LINE_TOP_TEXT_ICON_STYLE get_genlist_style(BT_GENLIST_2LINE) +#define BT_GENLIST_2LINE_TOP_TEXT_STYLE get_genlist_style(BT_GENLIST_1LINE) +#define BT_GENLIST_2LINE_TOP_TEXT_ICON_STYLE get_genlist_style(BT_GENLIST_1LINE) #define BT_GENLIST_2LINE_BOTTOM_TEXT_STYLE get_genlist_style(BT_GENLIST_2LINE) #define BT_GENLIST_2LINE_BOTTOM_TEXT_ICON_STYLE get_genlist_style(BT_GENLIST_2LINE) #define BT_GENLIST_MULTILINE_TEXT_STYLE get_genlist_style(BT_GENLIST_MULTILINE) diff --git a/common/src/ui/bt-main-view.c b/common/src/ui/bt-main-view.c index 338b66b..750b32b 100644 --- a/common/src/ui/bt-main-view.c +++ b/common/src/ui/bt-main-view.c @@ -130,11 +130,16 @@ static Evas_Object *__bt_main_onoff_icon_get(void *data, Evas_Object *obj, ugd = (bt_ug_data *)data; - if (!strcmp("elm.swallow.end", part)) { + if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { if (ugd->op_status == BT_ACTIVATING || ugd->op_status == BT_DEACTIVATING) { btn = elm_progressbar_add(obj); - elm_object_style_set(btn, "process_medium"); + + if (TIZEN_COMMON) + elm_object_style_set(btn, "process_small"); + else + elm_object_style_set(btn, "process_medium"); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.5); evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_progressbar_pulse(btn, TRUE); @@ -709,7 +714,7 @@ static Evas_Object *__bt_main_paired_device_icon_get(void *data, Evas_Object *ob dev = (bt_dev_t *)data; - if (!strcmp("elm.swallow.icon", part)) { + if (!strcmp("elm.swallow.icon", part) || !strcmp("elm.icon", part)) { if ((dev->major_class == BT_MAJOR_DEV_CLS_MISC) && (dev->service_list != 0)) _bt_util_update_class_of_device_by_service_list(dev->service_list, @@ -730,12 +735,20 @@ static Evas_Object *__bt_main_paired_device_icon_get(void *data, Evas_Object *ob else evas_object_color_set(dev->icon, 76, 76, 76, 255); - evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(40)); - } else if (!strcmp("elm.swallow.end", part)) { + if (TIZEN_COMMON) + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(30), ELM_SCALE_SIZE(30)); + else + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(40)); + } else if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { BT_INFO("status : %d", dev->status); + if (dev->status == BT_IDLE) { btn = elm_button_add(obj); - elm_object_style_set(btn, "info_button"); + + if (TIZEN_COMMON) + elm_object_style_set(btn, "info_button_small"); + else + elm_object_style_set(btn, "info_button"); evas_object_propagate_events_set(btn, EINA_FALSE); evas_object_smart_callback_add(btn, "clicked", @@ -744,7 +757,19 @@ static Evas_Object *__bt_main_paired_device_icon_get(void *data, Evas_Object *ob evas_object_show(btn); return btn; } else { - icon = _bt_create_progressbar(obj, "process_medium"); + btn = elm_progressbar_add(obj); + + if (TIZEN_COMMON) + elm_object_style_set(btn, "process_small"); + else + elm_object_style_set(btn, "process_medium"); + + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.5); + evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_progressbar_pulse(btn, TRUE); + + evas_object_show(btn); + return btn; } } @@ -806,7 +831,7 @@ static Evas_Object *__bt_main_searched_icon_get(void *data, dev = (bt_dev_t *)data; - if (!strcmp("elm.swallow.icon", part)) { + if (!strcmp("elm.swallow.icon", part) || !strcmp("elm.icon", part)) { dev_icon_file = _bt_main_get_device_icon(dev->major_class, dev->minor_class, @@ -818,7 +843,7 @@ static Evas_Object *__bt_main_searched_icon_get(void *data, else evas_object_color_set(icon, 76, 76, 76, 255); evas_object_propagate_events_set(icon, EINA_FALSE); - } else if (!strcmp("elm.swallow.end", part)) { + } else if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { if (dev->status != BT_IDLE) { icon = _bt_create_progressbar(obj, "process_medium"); evas_object_color_set(icon, 76, 76, 76, 255); @@ -827,7 +852,10 @@ static Evas_Object *__bt_main_searched_icon_get(void *data, if (icon) { evas_object_show(icon); - evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(40)); + if (TIZEN_COMMON) + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(30), ELM_SCALE_SIZE(30)); + else + evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(40)); } return icon; @@ -956,7 +984,7 @@ static Evas_Object *__bt_main_searched_title_icon_get(void *data, Evas_Object *o ugd = (bt_ug_data *)data; - if (!strcmp("elm.swallow.end", part) && ugd->op_status == BT_SEARCHING) + if ((!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) && ugd->op_status == BT_SEARCHING) progressbar = _bt_create_progressbar(obj, "process_small"); FN_END; diff --git a/common/src/ui/bt-profile-view.c b/common/src/ui/bt-profile-view.c index d9f4e16..e92eeec 100644 --- a/common/src/ui/bt-profile-view.c +++ b/common/src/ui/bt-profile-view.c @@ -913,7 +913,7 @@ static Evas_Object *__bt_profile_call_option_icon_get(void *data, Evas_Object *o dev = (bt_dev_t *)data; - if (!strcmp("elm.swallow.end", part)) { + if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { check = elm_check_add(obj); elm_object_style_set(check, "on&off"); @@ -948,7 +948,7 @@ static Evas_Object *__bt_profile_media_option_icon_get(void *data, Evas_Object * dev = (bt_dev_t *)data; - if (!strcmp("elm.swallow.end", part)) { + if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { check = elm_check_add(obj); elm_object_style_set(check, "on&off"); #ifdef TIZEN_BT_A2DP_SINK_ENABLE @@ -986,7 +986,7 @@ static Evas_Object *__bt_profile_hid_option_icon_get(void *data, Evas_Object *ob dev = (bt_dev_t *)data; - if (!strcmp("elm.swallow.end", part)) { + if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { check = elm_check_add(obj); elm_object_style_set(check, "on&off"); @@ -1020,7 +1020,7 @@ static Evas_Object *__bt_profile_nap_option_icon_get(void *data, Evas_Object *ob dev = (bt_dev_t *)data; - if (!strcmp("elm.swallow.end", part)) { + if (!strcmp("elm.swallow.end", part) || !strcmp("elm.end", part)) { check = elm_check_add(obj); elm_object_style_set(check, "on&off"); diff --git a/data/theme_2.3/bluetooth_genlist.edc b/data/theme_2.3/bluetooth_genlist.edc index f60c323..5088005 100644 --- a/data/theme_2.3/bluetooth_genlist.edc +++ b/data/theme_2.3/bluetooth_genlist.edc @@ -28,6 +28,7 @@ #define POPUP_WITH_2_GL_ITEMS 145 #define BUTTON_CIRCLE_LABEL_SIZE 80 80 #define BUTTON_CIRCLE_SIZE 40 40 +#define BUTTON_CIRCLE_SMALL_SIZE 25 25 #define BUTTON_CIRCLE_TOP_PADDING_HEIGHT 30 #define BUTTON_CIRCLE_LEFT_RIGHT_PADDING_WIDTH 8 #define BUTTON_CIRCLE_MIDDDLE_PADDING_HEIGHT 0 @@ -407,6 +408,205 @@ collections { } group { + name: "elm/button/base/info_button_small"; + script { + public mouse_down = 0; + public multi_down = 0; + } + images { + image: "bluetooth_btn_bg.png" COMP; + image: "bluetooth_btn_icon_info.png" COMP; + } + parts { + part { name: "bg"; + type: SPACER; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: BUTTON_CIRCLE_SMALL_SIZE; + max: BUTTON_CIRCLE_SMALL_SIZE; + } + } + part { + name: "bg_image"; + scale: 1; + description { + state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + image.normal: "bluetooth_btn_bg.png"; + color: 66 162 206 255; + } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + color: 53 132 168 255; + } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + color: 107 175 206 255; + } + } + part { name: "button"; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: BUTTON_CIRCLE_SMALL_SIZE; + max: BUTTON_CIRCLE_SMALL_SIZE; + rel1.to: "bg_image"; + rel2.to: "bg_image"; + image.normal: "bluetooth_btn_icon_info.png"; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + description { + state: "disabled" 0.0; + inherit: "default" 0.0; + color: 255 255 255 127; + } + } + part { + name: "event"; + scale: 1; + type: RECT; + description { + state: "default" 0.0; + rel1.to:"bg"; + rel2.to:"bg"; + color: 0 0 0 0; + } + } + } + programs { + program { + name: "pressed"; + signal: "mouse,down,1*"; + source: "event"; + script { + if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0)) + { + set_int(mouse_down, 1); + run_program(PROGRAM:"button_press1"); + } + } + } + program { + name: "button_press1"; + script { + new st[31]; + new Float:vl; + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + //set_state(PART:"base", "pressed", 0.0); + set_state(PART:"bg_image", "pressed", 0.0); + set_state(PART:"button", "pressed", 0.0); + emit("elm,action,press", ""); + } + } + } + program { + name: "unpressed"; + signal: "mouse,up,1"; + source: "event"; + script { + if (get_int(mouse_down) == 1) { + set_int(mouse_down, 0); + run_program(PROGRAM:"button_unpress1"); + } + } + } + program { + name: "button_unpress1"; + script { + new st[31]; + new Float:vl; + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + //set_state(PART:"base", "default", 0.0); + set_state(PART:"bg_image", "default", 0.0); + set_state(PART:"button", "default", 0.0); + emit("elm,action,unpress", ""); + } + } + } + program { + name: "touch_snd"; + signal: "mouse,clicked,1"; + source: "event"; + script { + new st[31]; + new Float:vl; + if (get_int(multi_down) == 0) { + get_state(PART:"bg", st, 30, vl); + if (strcmp(st, "disabled")) { + run_program(PROGRAM:"touch_sound"); + emit("elm,action,click", ""); + } + } + } + } + program { + name: "touch_sound"; + action: RUN_PLUGIN "touch_sound"; + } + program { + name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "button"; + } + program { + name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "button"; + } + program { + name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "bg"; + //target: "bg_effect"; + target: "button"; + } + program { + name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + //target: "bg_effect"; + target: "button"; + } + program { + name: "multi_down"; + signal: "elm,action,multi,down"; + source: "elm"; + script { + set_int(multi_down, 1); + } + } + program { + name: "multi_up"; + signal: "elm,action,multi,up"; + source: "elm"; + script { + set_int(multi_down, 0); + } + } + } + } + + + group { name: "gl_custom_item"; styles { style { -- 2.7.4