summaryrefslogtreecommitdiff
path: root/data/elementary/themes/edc
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-10-25 14:04:39 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-25 14:04:40 -0400
commita23b5452492c1af5fee07ec5d5ff376a8f264d3a (patch)
tree3b1492b50b3058dcb4a16261a35481503d70401b /data/elementary/themes/edc
parent6abba55b5c502cced32e39d699e777661418291b (diff)
theme: redo scroller theme of elm
Summary: this was a little bit weird. There was a script that did what we already do in C and pass it on via signals, however, there was also somewhere a bug in this script, the arrow was not getting enabled, even if the position is not completly max and not completly min, the problem here was that the numbers that are passed to edje are not 100% correct (I think they got somehwere on the way casted to an int). With this commit we just use the signals from c in the theme and replace the theme, this should also make everything a bit easier on the mainloop, as a single movement of the scroller does not schedule 10 timers anymore. ref T4918 Reviewers: zmike, eagleeye, woohyun Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T4918 Differential Revision: https://phab.enlightenment.org/D9906
Diffstat (limited to 'data/elementary/themes/edc')
-rw-r--r--data/elementary/themes/edc/elm/scroller.edc177
1 files changed, 50 insertions, 127 deletions
diff --git a/data/elementary/themes/edc/elm/scroller.edc b/data/elementary/themes/edc/elm/scroller.edc
index 091cfb1..71a050d 100644
--- a/data/elementary/themes/edc/elm/scroller.edc
+++ b/data/elementary/themes/edc/elm/scroller.edc
@@ -34,91 +34,9 @@ group { name: "elm/scroller/base/default";
34 images.image: "sym_left_dark_normal.png" COMP; 34 images.image: "sym_left_dark_normal.png" COMP;
35 images.image: "sym_right_dark_normal.png" COMP; 35 images.image: "sym_right_dark_normal.png" COMP;
36 36
37
38 data.item: "focus_highlight" "on"; 37 data.item: "focus_highlight" "on";
39 38
40 script {
41 public loop_x, loop_y;
42 public action_on_pos_vbar(val) {
43 new x, y , w, h, x1, y1 , w1, h1;
44
45 get_geometry(PART:"y_vbar_up", x,y,w, h);
46 get_geometry(PART:"y_vbar_up_mapper", x1,y1,w1, h1);
47
48 if(((y1 <= y) && (y <= (y1 + h1))) && (0 == get_int(loop_y)))
49 {
50 set_state(PART:"arrow1_vbar", "hidden", 0.0);
51 set_state(PART:"sb_vbar_a1", "hidden", 0.0);
52 }
53 else
54 {
55 set_state(PART:"arrow1_vbar", "default", 0.0);
56 set_state(PART:"sb_vbar_a1", "default", 0.0);
57 }
58
59 get_geometry(PART:"y_vbar_down", x,y,w, h);
60 get_geometry(PART:"y_vbar_down_mapper", x1,y1,w1, h1);
61
62 if(((y1 <= (y + h)) && ((y+ h) <= (y1 + h1))) && (0 == get_int(loop_y)))
63 {
64 set_state(PART:"arrow2_vbar", "hidden", 0.0);
65 set_state(PART:"sb_vbar_a2", "hidden", 0.0);
66 }
67 else
68 {
69 set_state(PART:"arrow2_vbar", "default", 0.0);
70 set_state(PART:"sb_vbar_a2", "default", 0.0);
71 }
72
73 if(val < 10)
74 timer(0.1,"action_on_pos_vbar", val+1);
75 }
76
77 public action_on_pos_hbar(val) {
78 new x, y , w, h, x1, y1 , w1, h1;
79
80 get_geometry(PART:"x_hbar_left", x,y,w, h);
81 get_geometry(PART:"x_hbar_left_mapper", x1,y1,w1, h1);
82
83 if(((x1 <= x) && (x <= (x1 + w1))) && (0 == get_int(loop_x)))
84 {
85 set_state(PART:"arrow1_hbar", "hidden", 0.0);
86 set_state(PART:"sb_hbar_a1", "hidden", 0.0);
87 }
88 else
89 {
90 set_state(PART:"arrow1_hbar", "default", 0.0);
91 set_state(PART:"sb_hbar_a1", "default", 0.0);
92 }
93
94 get_geometry(PART:"x_hbar_right", x,y,w, h);
95 get_geometry(PART:"x_hbar_right_mapper", x1,y1,w1, h1);
96
97 if(((x1 <= (x + w)) && ((x + w) <= (x1 + w1))) && (0 == get_int(loop_x)))
98 {
99 set_state(PART:"arrow2_hbar", "hidden", 0.0);
100 set_state(PART:"sb_hbar_a2", "hidden", 0.0);
101 }
102 else
103 {
104 set_state(PART:"arrow2_hbar", "default", 0.0);
105 set_state(PART:"sb_hbar_a2", "default", 0.0);
106 }
107
108 if(val < 10)
109 timer(0.1,"action_on_pos_hbar", val+1);
110 }
111 }
112
113 parts { 39 parts {
114 program {
115 signal: "load"; source: "";
116 script {
117 emit("reload", "elm");
118 action_on_pos_vbar(0);
119 action_on_pos_hbar(0);
120 }
121 }
122// vert bar //////////////////////////////////////////////////////////////// 40// vert bar ////////////////////////////////////////////////////////////////
123 part { name: "sb_vbar_show"; type: RECT; 41 part { name: "sb_vbar_show"; type: RECT;
124 description { state: "default" 0.0; 42 description { state: "default" 0.0;
@@ -321,7 +239,6 @@ group { name: "elm/scroller/base/default";
321 target: "y_vbar_down"; 239 target: "y_vbar_down";
322 target: "arrow1_vbar_indent"; 240 target: "arrow1_vbar_indent";
323 target: "arrow2_vbar_indent"; 241 target: "arrow2_vbar_indent";
324 after: "check_pos_vbar";
325 } 242 }
326 program { 243 program {
327 signal: "elm,action,hide,vbar"; source: "elm"; 244 signal: "elm,action,hide,vbar"; source: "elm";
@@ -340,11 +257,13 @@ group { name: "elm/scroller/base/default";
340 } 257 }
341 program { 258 program {
342 signal: "mouse,down,1*"; source: "sb_vbar_a1";//ok 259 signal: "mouse,down,1*"; source: "sb_vbar_a1";//ok
260 filter: "sb_vbar_a1" "default";
343 action: STATE_SET "clicked" 0.0; 261 action: STATE_SET "clicked" 0.0;
344 target: "arrow1_vbar"; 262 target: "arrow1_vbar";
345 after: "anim1_up"; 263 after: "anim1_up";
346 } 264 }
347 program { name: "anim1_up"; 265 program { name: "anim1_up";
266 filter: "sb_vbar_a1" "default";
348 action: STATE_SET "default" 0.0; 267 action: STATE_SET "default" 0.0;
349 transition: LINEAR 0.1; 268 transition: LINEAR 0.1;
350 target: "arrow1_vbar"; 269 target: "arrow1_vbar";
@@ -356,11 +275,13 @@ group { name: "elm/scroller/base/default";
356 } 275 }
357 program { 276 program {
358 signal: "mouse,down,1*"; source: "sb_vbar_a2";//ok 277 signal: "mouse,down,1*"; source: "sb_vbar_a2";//ok
278 filter: "sb_vbar_a2" "default";
359 action: STATE_SET "clicked" 0.0; 279 action: STATE_SET "clicked" 0.0;
360 target: "arrow2_vbar"; 280 target: "arrow2_vbar";
361 after: "anim1_down"; 281 after: "anim1_down";
362 } 282 }
363 program { name: "anim1_down"; 283 program { name: "anim1_down";
284 filter: "sb_vbar_a2" "default";
364 action: STATE_SET "default" 0.0; 285 action: STATE_SET "default" 0.0;
365 transition: LINEAR 0.1; 286 transition: LINEAR 0.1;
366 target: "arrow2_vbar"; 287 target: "arrow2_vbar";
@@ -372,40 +293,40 @@ group { name: "elm/scroller/base/default";
372 } 293 }
373 program { 294 program {
374 signal: "mouse,down,1*"; source: "sb_vbar_p1"; 295 signal: "mouse,down,1*"; source: "sb_vbar_p1";
296 filter: "sb_vbar_a1" "default";
375 action: DRAG_VAL_PAGE 0.0 -1.0; 297 action: DRAG_VAL_PAGE 0.0 -1.0;
376 target: "elm.dragable.vbar"; 298 target: "elm.dragable.vbar";
377 } 299 }
378 program { 300 program {
379 signal: "mouse,down,1*"; source: "sb_vbar_p2"; 301 signal: "mouse,down,1*"; source: "sb_vbar_p2";
302 filter: "sb_vbar_a2" "default";
380 action: DRAG_VAL_PAGE 0.0 1.0; 303 action: DRAG_VAL_PAGE 0.0 1.0;
381 target: "elm.dragable.vbar"; 304 target: "elm.dragable.vbar";
382 } 305 }
383 program { 306 program {
384 signal: "elm,action,scroll"; source: "elm"; 307 signal: "elm,action,show,up"; source: "elm";
385 script { 308 action: STATE_SET "default" 0.0;
386 action_on_pos_vbar(10); 309 target: "arrow1_vbar";
387 } 310 target: "sb_vbar_a1";
388 } 311 }
389 program { name: "check_pos_vbar"; 312 program {
390 script { 313 signal: "elm,action,hide,up"; source: "elm";
391 action_on_pos_vbar(10); 314 action: STATE_SET "hidden" 0.0;
392 } 315 target: "arrow1_vbar";
316 target: "sb_vbar_a1";
393 } 317 }
394 program { name: "loop_set_vbar"; 318 program {
395 signal: "elm,loop_y,set"; source: "elm"; 319 signal: "elm,action,show,down"; source: "elm";
396 script { 320 action: STATE_SET "default" 0.0;
397 set_int(loop_y, 1); 321 target: "arrow2_vbar";
398 action_on_pos_vbar(10); 322 target: "sb_vbar_a2";
399 }
400 } 323 }
401 program { name: "loop_unset_vbar"; 324 program {
402 signal: "elm,loop_y,unset"; source: "elm"; 325 signal: "elm,action,hide,down"; source: "elm";
403 script { 326 action: STATE_SET "hidden" 0.0;
404 set_int(loop_y, 0); 327 target: "arrow2_vbar";
405 action_on_pos_vbar(10); 328 target: "sb_vbar_a2";
406 }
407 } 329 }
408
409// horiz bar ///////////////////////////////////////////////////////////// 330// horiz bar /////////////////////////////////////////////////////////////
410 part { name: "sb_hbar_show"; type: RECT; 331 part { name: "sb_hbar_show"; type: RECT;
411 description { state: "default" 0.0; 332 description { state: "default" 0.0;
@@ -608,7 +529,6 @@ group { name: "elm/scroller/base/default";
608 target: "x_hbar_right"; 529 target: "x_hbar_right";
609 target: "arrow1_hbar_indent"; 530 target: "arrow1_hbar_indent";
610 target: "arrow2_hbar_indent"; 531 target: "arrow2_hbar_indent";
611 after: "check_pos_hbar";
612 } 532 }
613 program { 533 program {
614 signal: "elm,action,hide,hbar"; source: "elm"; 534 signal: "elm,action,hide,hbar"; source: "elm";
@@ -627,11 +547,13 @@ group { name: "elm/scroller/base/default";
627 } 547 }
628 program { 548 program {
629 signal: "mouse,down,1*"; source: "sb_hbar_a1"; 549 signal: "mouse,down,1*"; source: "sb_hbar_a1";
550 filter: "sb_hbar_a1" "default";
630 action: STATE_SET "clicked" 0.0; 551 action: STATE_SET "clicked" 0.0;
631 target: "arrow1_hbar"; 552 target: "arrow1_hbar";
632 after: "anim1_left"; 553 after: "anim1_left";
633 } 554 }
634 program { name: "anim1_left"; 555 program { name: "anim1_left";
556 filter: "sb_hbar_a1" "default";
635 action: STATE_SET "default" 0.0; 557 action: STATE_SET "default" 0.0;
636 transition: LINEAR 0.1; 558 transition: LINEAR 0.1;
637 target: "arrow1_hbar"; 559 target: "arrow1_hbar";
@@ -643,11 +565,13 @@ group { name: "elm/scroller/base/default";
643 } 565 }
644 program { 566 program {
645 signal: "mouse,down,1*"; source: "sb_hbar_a2"; 567 signal: "mouse,down,1*"; source: "sb_hbar_a2";
568 filter: "sb_hbar_a2" "default";
646 action: STATE_SET "clicked" 0.0; 569 action: STATE_SET "clicked" 0.0;
647 target: "arrow2_hbar"; 570 target: "arrow2_hbar";
648 after: "anim2_left"; 571 after: "anim2_left";
649 } 572 }
650 program { name: "anim2_left"; 573 program { name: "anim2_left";
574 filter: "sb_hbar_a2" "default";
651 action: STATE_SET "default" 0.0; 575 action: STATE_SET "default" 0.0;
652 transition: LINEAR 0.1; 576 transition: LINEAR 0.1;
653 target: "arrow2_hbar"; 577 target: "arrow2_hbar";
@@ -659,40 +583,39 @@ group { name: "elm/scroller/base/default";
659 } 583 }
660 program { 584 program {
661 signal: "mouse,down,1*"; source: "sb_hbar_p1"; 585 signal: "mouse,down,1*"; source: "sb_hbar_p1";
586 filter: "sb_hbar_a1" "default";
662 action: DRAG_VAL_PAGE -1.0 0.0; 587 action: DRAG_VAL_PAGE -1.0 0.0;
663 target: "elm.dragable.hbar"; 588 target: "elm.dragable.hbar";
664 after: "check_pos_hbar";
665 } 589 }
666 program { 590 program {
667 signal: "mouse,down,1*"; source: "sb_hbar_p2"; 591 signal: "mouse,down,1*"; source: "sb_hbar_p2";
592 filter: "sb_hbar_a2" "default";
668 action: DRAG_VAL_PAGE 1.0 0.0; 593 action: DRAG_VAL_PAGE 1.0 0.0;
669 target: "elm.dragable.hbar"; 594 target: "elm.dragable.hbar";
670 after: "check_pos_hbar";
671 } 595 }
672 program { 596 program {
673 signal: "elm,action,scroll"; source: "elm"; 597 signal: "elm,action,show,left"; source: "elm";
674 script { 598 action: STATE_SET "default" 0.0;
675 action_on_pos_hbar(10); 599 target: "arrow1_hbar";
676 } 600 target: "sb_hbar_a1";
677 } 601 }
678 program { name: "check_pos_hbar"; 602 program {
679 script { 603 signal: "elm,action,hide,left"; source: "elm";
680 action_on_pos_hbar(10); 604 action: STATE_SET "hidden" 0.0;
681 } 605 target: "arrow1_hbar";
606 target: "sb_hbar_a1";
682 } 607 }
683 program { name: "loop_set_hbar"; 608 program {
684 signal: "elm,loop_x,set"; source: "elm"; 609 signal: "elm,action,show,right"; source: "elm";
685 script { 610 action: STATE_SET "default" 0.0;
686 set_int(loop_x, 1); 611 target: "arrow2_hbar";
687 action_on_pos_hbar(10); 612 target: "sb_hbar_a2";
688 }
689 } 613 }
690 program { name: "loop_unset_hbar"; 614 program {
691 signal: "elm,loop_x,unset"; source: "elm"; 615 signal: "elm,action,hide,right"; source: "elm";
692 script { 616 action: STATE_SET "hidden" 0.0;
693 set_int(loop_x, 0); 617 target: "arrow2_hbar";
694 action_on_pos_hbar(10); 618 target: "sb_hbar_a2";
695 }
696 } 619 }
697 part { name: "bg"; type: RECT; 620 part { name: "bg"; type: RECT;
698 description { state: "default" 0.0; 621 description { state: "default" 0.0;