button: set different state as focusing 13/46513/1
authorMinkyu Kang <mk7.kang@samsung.com>
Fri, 21 Aug 2015 08:27:48 +0000 (17:27 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Fri, 21 Aug 2015 08:27:48 +0000 (17:27 +0900)
Change-Id: Ie6ef359ccfec704f95c3ac89ca01ff8fb4014ead
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
res/edc/widgets/button.edc

index e8a039b..3973cc9 100644 (file)
@@ -714,6 +714,7 @@ group {
        }
        script {
                public cur_state;
+               public focused;
        }
        parts {
                part {
@@ -798,9 +799,18 @@ group {
                        signal: SIG_SET_PLAY;
                        source: "";
                        script {
+                               new state;
+                               state = get_int(focused);
+
+                               if (state == STATE_NORMAL) {
+                                       set_state(PART:"bg", "default", 0.0);
+                                       set_state(PART:"color", "default", 0.0);
+                               } else {
+                                       set_state(PART:"bg", "selected", 0.0);
+                                       set_state(PART:"color", "selected", 0.0);
+                               }
+
                                set_int(cur_state, STATE_PLAY);
-                               set_state(PART:"bg", "default", 0.0);
-                               set_state(PART:"color", "default", 0.0);
                        }
                }
                program {
@@ -808,9 +818,18 @@ group {
                        signal: SIG_SET_PAUSE;
                        source: "";
                        script {
+                               new state;
+                               state = get_int(focused);
+
+                               if (state == STATE_NORMAL) {
+                                       set_state(PART:"bg", "default_pause", 0.0);
+                                       set_state(PART:"color", "default_pause", 0.0);
+                               } else {
+                                       set_state(PART:"bg", "selected_pause", 0.0);
+                                       set_state(PART:"color", "selected_pause", 0.0);
+                               }
+
                                set_int(cur_state, STATE_PAUSE);
-                               set_state(PART:"bg", "default_pause", 0.0);
-                               set_state(PART:"color", "default_pause", 0.0);
                        }
                }
                program {
@@ -892,6 +911,8 @@ group {
                                        run_program(PROGRAM:"focused,play");
                                else
                                        run_program(PROGRAM:"focused,pause");
+
+                               set_int(focused, STATE_FOCUSED);
                        }
                }
                program {
@@ -906,6 +927,8 @@ group {
                                        run_program(PROGRAM:"unfocused,play");
                                else
                                        run_program(PROGRAM:"unfocused,pause");
+
+                               set_int(focused, STATE_NORMAL);
                        }
                }
                program {
@@ -1270,6 +1293,7 @@ group {
        }
        script {
                public cur_state;
+               public focused;
        }
        parts {
                part {
@@ -1355,9 +1379,18 @@ group {
                        signal: SIG_SET_PLAY;
                        source: "";
                        script {
+                               new state;
+                               state = get_int(focused);
+
+                               if (state == STATE_NORMAL) {
+                                       set_state(PART:"bg", "default", 0.0);
+                                       set_state(PART:"color", "default", 0.0);
+                               } else {
+                                       set_state(PART:"bg", "selected", 0.0);
+                                       set_state(PART:"color", "selected", 0.0);
+                               }
+
                                set_int(cur_state, STATE_PLAY);
-                               set_state(PART:"bg", "default", 0.0);
-                               set_state(PART:"color", "default", 0.0);
                        }
                }
                program {
@@ -1365,9 +1398,18 @@ group {
                        signal: SIG_SET_PAUSE;
                        source: "";
                        script {
+                               new state;
+                               state = get_int(focused);
+
+                               if (state == STATE_NORMAL) {
+                                       set_state(PART:"bg", "default_pause", 0.0);
+                                       set_state(PART:"color", "default_pause", 0.0);
+                               } else {
+                                       set_state(PART:"bg", "selected_pause", 0.0);
+                                       set_state(PART:"color", "selected_pause", 0.0);
+                               }
+
                                set_int(cur_state, STATE_PAUSE);
-                               set_state(PART:"bg", "default_pause", 0.0);
-                               set_state(PART:"color", "default_pause", 0.0);
                        }
                }
                program {
@@ -1449,6 +1491,8 @@ group {
                                        run_program(PROGRAM:"focused,play");
                                else
                                        run_program(PROGRAM:"focused,pause");
+
+                               set_int(focused, STATE_FOCUSED);
                        }
                }
                program {
@@ -1463,6 +1507,8 @@ group {
                                        run_program(PROGRAM:"unfocused,play");
                                else
                                        run_program(PROGRAM:"unfocused,pause");
+
+                               set_int(focused, STATE_NORMAL);
                        }
                }
                program {