From: Amit Kamboj Date: Sat, 11 May 2013 09:00:03 +0000 (+0530) Subject: [Radio] Fixed radio missing if we tap radio quickly. X-Git-Tag: submit/tizen/20131004.114939~300 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e39e25faef0f48d69b46233a8c2539423499cab;p=platform%2Fcore%2Fuifw%2Fefl-theme-tizen.git [Radio] Fixed radio missing if we tap radio quickly. Change-Id: If32870e101229315e0e3d9b3707aa304a282373d Conflicts: themes/widgets/radio.edc --- diff --git a/themes/widgets/radio.edc b/themes/widgets/radio.edc index 176b740..01a9b7a 100644 --- a/themes/widgets/radio.edc +++ b/themes/widgets/radio.edc @@ -15,12 +15,8 @@ * limitations under the License. */ - - -#define RADIO_STATE_DEFAULT 0 -#define RADIO_STATE_VISIBLE 1 -#define RADIO_STATE_DISABLED_VISIBLE 2 -#define RADIO_STATE_DISABLED 3 +#define RADIO_STATE_DEFAULT 0 // radio is off +#define RADIO_STATE_VISIBLE 1 // radio is on styles { style { name: "radio_label_textblock_style"; @@ -45,6 +41,9 @@ image: "00_button_radio_press_bg.png" COMP; \ image: "00_button_radio_press.png" COMP; \ } \ + script { \ + public radio_state = RADIO_STATE_DEFAULT; \ + } \ parts { \ part { name: "back_bg"; \ type: RECT; \ @@ -240,13 +239,10 @@ signal: "mouse,up,1"; \ source: "over2"; \ script { \ - new st[31]; \ - new Float:vl; \ - get_state(PART:"radio", st, 30, vl); \ - if (!strcmp(st, "pressed")) \ - set_state(PART:"radio", "visible", 0.0); \ + if (get_int(radio_state) == RADIO_STATE_VISIBLE) \ + set_state(PART:"radio", "visible", 0.0); \ else \ - set_state(PART:"radio", "default", 0.0); \ + set_state(PART:"radio", "default", 0.0); \ set_state(PART:"bg", "default", 0.0); \ } \ } \ @@ -254,13 +250,10 @@ signal: "mouse,down,1"; \ source: "over2"; \ script { \ - new st[31]; \ - new Float:vl; \ - get_state(PART:"radio", st, 30, vl); \ - if (!strcmp(st, "visible")) \ - set_state(PART:"radio", "pressed", 0.0); \ + if (get_int(radio_state) == RADIO_STATE_VISIBLE) \ + set_state(PART:"radio", "pressed", 0.0); \ else \ - set_state(PART:"radio", "default", 0.0); \ + set_state(PART:"radio", "default", 0.0); \ set_state(PART:"bg", "pressed", 0.0); \ } \ } \ @@ -268,13 +261,10 @@ signal: "mouse,out"; \ source: "over2"; \ script { \ - new st[31]; \ - new Float:vl; \ - get_state(PART:"radio", st, 30, vl); \ - if (!strcmp(st, "visible")) \ - set_state(PART:"radio", "visible", 0.0); \ + if (get_int(radio_state) == RADIO_STATE_VISIBLE) \ + set_state(PART:"radio", "visible", 0.0); \ else \ - set_state(PART:"radio", "default", 0.0); \ + set_state(PART:"radio", "default", 0.0); \ set_state(PART:"bg", "default", 0.0); \ } \ } \ @@ -282,6 +272,7 @@ signal: "elm,state,radio,on"; \ source: "elm"; \ script { \ + set_int(radio_state, RADIO_STATE_VISIBLE); \ run_program(PROGRAM:"radio_show_effect"); \ run_program(PROGRAM:"radio_draw_effect"); \ } \ @@ -290,6 +281,7 @@ signal: "elm,state,radio,off"; \ source: "elm"; \ script { \ + set_int(radio_state, RADIO_STATE_DEFAULT); \ set_state(PART:"opacity_clip", "default", 0.0); \ set_state(PART:"radio", "default", 0.0); \ } \ @@ -407,5 +399,3 @@ RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MI #undef RADIO_STATE_DEFAULT #undef RADIO_STATE_VISIBLE -#undef RADIO_STATE_DISABLED_VISIBLE -#undef RADIO_STATE_DISABLED