Modify the wearable button focus style 82/60382/3 accepted/tizen/mobile/20160226.040341 accepted/tizen/tv/20160226.040401 accepted/tizen/wearable/20160226.040418 submit/tizen_mobile/20160226.021331 submit/tizen_tv/20160226.021343 submit/tizen_wearable/20160226.021347
authorHyuk Lee <hyuk0512.lee@samsung.com>
Fri, 26 Feb 2016 01:25:42 +0000 (10:25 +0900)
committerHyuk Lee <hyuk0512.lee@samsung.com>
Fri, 26 Feb 2016 01:55:26 +0000 (10:55 +0900)
Change-Id: I2d73ccd6e1173820d43e2b12cb96044fb641f673
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
data/groups/passkey_confirm_popup.edc
src/bt-syspopup-w.c

index 2750314..3df4bb7 100644 (file)
@@ -161,3 +161,89 @@ group { name: "passkey_confirm_popup_scroller";
                }
        }
 }
+
+group { name: "elm/button/base/custom_focus_style";
+       data {
+               item: "focus_highlight" "on";
+       }
+       images {
+               image: image_normal COMP;
+       }
+       script {
+               public mouse_down = 0;
+               public multi_down = 0;
+       }
+       parts {
+               part { name: "elm.swallow.content";
+                          type: SWALLOW;
+                          scale: 1;
+                          description { state: "default" 0.0;
+          }
+               }
+               part { name: "over2";
+                         type: RECT;
+                         repeat_events: 1;
+                         ignore_flags: ON_HOLD;
+                         description { state: "default" 0.0;
+                                                       color: 0 0 0 0;
+                         }
+               }
+               part { name: "over3";
+                               type: RECT;
+                               repeat_events: 1;
+                               description { state: "default" 0.0;
+                               color: 0 0 0 0;
+                          }
+               }
+       }
+       programs {
+               program { name: "button_press";
+                                       signal: "mouse,down,1*";
+                                       source: "over2";
+                                       script {
+                                               if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
+                                               {
+                                                       set_int(mouse_down, 1);
+                                                       emit("elm,action,press", "");
+                                               }
+                                       }
+               }
+               program { name: "button_unpress";
+                                       signal: "mouse,up,1*";
+                                       source: "over3";
+                                       script {
+                                               if (get_int(mouse_down) == 1)
+                                               {
+                                                       set_int(mouse_down, 0);
+                                                       emit("elm,action,unpress", "");
+                                               }
+                                       }
+               }
+               program { name: "button_click";
+                               signal: "mouse,clicked,1";
+                               source: "over2";
+                               script {
+                                       if (get_int(multi_down) == 0) {
+                                               emit("elm,action,click", "");
+                                       }
+                               }
+               }
+               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);
+                               }
+               }
+       }
+}
+
index ae2e23c..f07bc35 100644 (file)
@@ -1430,6 +1430,7 @@ static void __bluetooth_draw_input_view(struct bt_popup_appdata *ad,
        Evas_Object *default_ly = NULL;
        Evas_Object *scroller;
        Elm_Object_Item *navi_item;
+       Elm_Theme *th;
        static  char *buf;
        int i = 0, r = 0, g = 0, b = 0, a = 0;
        char *font;
@@ -1503,6 +1504,10 @@ static void __bluetooth_draw_input_view(struct bt_popup_appdata *ad,
        elm_object_part_content_set(ad->ly_pass, "sw.keypad", layout_key);
        elm_object_part_text_set(layout_key, "confirm", "OK");
 
+       th = elm_theme_new();
+       elm_theme_ref_set(th, NULL);
+       elm_theme_extension_add(th, CUSTOM_POPUP_PATH);
+
        for (i = 0; i< 12; i++) {
                Evas_Object *button = elm_button_add(layout_key);
                char buf[32] = {0,};
@@ -1510,7 +1515,8 @@ static void __bluetooth_draw_input_view(struct bt_popup_appdata *ad,
                        BT_DBG("elm_button_add() failed");
                        continue;
                }
-               elm_object_style_set(button, "focus");
+               elm_object_theme_set(button, th);
+               elm_object_style_set(button, "custom_focus_style");
                snprintf(buf, sizeof(buf)-1, "%s,sw", keypad_info[i].part_name);
                elm_object_part_content_set(layout_key, buf, button);
                elm_access_info_set(button, ELM_ACCESS_INFO, keypad_info[i].tts_name);
@@ -1520,6 +1526,9 @@ static void __bluetooth_draw_input_view(struct bt_popup_appdata *ad,
                keypad_info[i].tts_button = button;
        }
 
+       elm_theme_extension_del(th, CUSTOM_POPUP_PATH);
+       elm_theme_free(th);
+
        navi_item = elm_naviframe_item_push(naviframe, BT_STR_PAIRING_REQUEST,
                        NULL, NULL, layout, NULL);
        elm_naviframe_item_title_enabled_set(navi_item, EINA_TRUE, EINA_TRUE);