theme: make spin button work better
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Wed, 1 Jan 2020 13:13:46 +0000 (14:13 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 13 Jan 2020 21:11:02 +0000 (06:11 +0900)
this is now using the EFL_UI_CLICKABLE_PART_BIND macro, which makes
multiple clicks work correctly, which improves the overall usability of
the widget.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11000

data/elementary/themes/edc/efl/spin_button.edc

index 5b257f2..674ff69 100644 (file)
@@ -279,10 +279,6 @@ group { "efl/spin_button/horizontal/inc_button";
    images.image: "sym_right_light_normal.png" COMP;
    images.image: "sym_right_glow_normal.png" COMP;
    images.image: "sym_right_dark_normal.png" COMP;
-   script {
-      public mouse_down = 0;
-      public multi_down = 0;
-   }
    parts {
       part { name: "arrow.image";
          scale: 1;
@@ -321,64 +317,31 @@ group { "efl/spin_button/horizontal/inc_button";
       }
    }
    programs {
+      EFL_UI_CLICKABLE_PART_BIND(over)
       program { name: "button_press";
          signal: "mouse,down,1";
          source: "over";
-         script {
-            if ((get_int(multi_down) == 0) &&
-                (get_int(mouse_down) == 0)) {
-                  set_int(mouse_down, 1);
-                  run_program(PROGRAM:"button_press2");
-            }
-         }
-      }
-      program { name: "button_press2";
-         action: SIGNAL_EMIT "efl,action,press" "";
-         after: "button_press_anim";
-      }
-      program { name: "button_press_anim";
          action: STATE_SET "pressed" 0.0;
          target: "arrow.image";
       }
       program { name: "button_unpress";
          signal: "mouse,up,1";
          source: "over";
-         script {
-            if (get_int(mouse_down) == 1) {
-                  set_int(mouse_down, 0);
-                  run_program(PROGRAM:"button_unpress2");
-                  run_program(PROGRAM:"button_unpress_anim");
-            }
-         }
-      }
-      program { name: "button_unpress2";
-         action: SIGNAL_EMIT "efl,action,unpress" "";
-      }
-      program { name: "button_unpress_anim";
          action: STATE_SET "default" 0.0;
          target: "arrow.image";
       }
-      program { name: "button_click";
-         signal: "mouse,clicked,1";
-         source: "over";
-         script {
-            if (get_int(multi_down) == 0) {
-              run_program(PROGRAM:"button_click2");
-            }
-         }
-      }
       program { name: "action_unpressed";
          signal: "efl,action,unpressed";
          source: "efl";
-         after: "button_unpress_anim";
+         action: STATE_SET "default" 0.0;
+         target: "arrow.image";
+
       }
       program { name: "action_pressed";
          signal: "efl,action,pressed";
          source: "efl";
-         after: "button_press_anim";
-      }
-      program { name: "button_click2";
-         action: SIGNAL_EMIT "efl,action,click" "";
+         action: STATE_SET "pressed" 0.0;
+         target: "arrow.image";
       }
       program { name: "access_pressed";
          signal: "efl,state,animation,activated";
@@ -406,22 +369,6 @@ group { "efl/spin_button/horizontal/inc_button";
          target: "arrow.image";
          target: "disabler";
       }
-      program {
-         name: "multi_down";
-         signal: "efl,action,multi,down";
-         source: "efl";
-         script {
-            set_int(multi_down, 1);
-         }
-      }
-      program {
-         name: "multi_up";
-         signal: "efl,action,multi,up";
-         source: "efl";
-         script {
-            set_int(multi_down, 0);
-         }
-      }
    }
 }