summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-03-06 18:56:58 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-03-06 18:59:31 -0500
commit34d1bbd63179d5a91b1d9ea49fc0bfc9525b3421 (patch)
tree715ef68c676c2f2aa2c2b987504650af79433ab1
parent073bac747bac1bafd9fbae4a37280dcf12d40e76 (diff)
ibar/ibox icon label positioning rewrite
the original code for handling label positioning was not robust enough to handle cases such as ibar scrolling or gadget moving. this greatly simplifies the code as well as handling all cases and providing small animations for moving the label when necessary
-rw-r--r--data/themes/edc/ibar-ibox.edc114
1 files changed, 43 insertions, 71 deletions
diff --git a/data/themes/edc/ibar-ibox.edc b/data/themes/edc/ibar-ibox.edc
index fbd13c371..02664ae47 100644
--- a/data/themes/edc/ibar-ibox.edc
+++ b/data/themes/edc/ibar-ibox.edc
@@ -431,31 +431,6 @@ group { name: "e/modules/ibox/icon_overlay";
431 images.image: "darken_rounded_square.png" COMP; 431 images.image: "darken_rounded_square.png" COMP;
432 script { 432 script {
433 public urgent; 433 public urgent;
434 public origin;
435
436 public refresh_origin(){
437 new partid;
438
439 partid = get_part_id("e.text.label");
440 custom_state(partid, "default", 0.0);
441
442 if (get_int(origin) == 2){
443 //top
444 set_state_val(partid, STATE_ALIGNMENT, 0.5, 0.5);
445 }else if (get_int(origin) == 3){
446 //right
447 set_state_val(partid, STATE_ALIGNMENT, 0.0, 0.5);
448 }else if (get_int(origin) == 4){
449 //left
450 set_state_val(partid, STATE_ALIGNMENT, 1.0, 0.5);
451 }else{
452 //bottom
453 set_state_val(partid, STATE_ALIGNMENT, 0.5, 0.5);
454 }
455
456 /* apply the custom state */
457 set_state(partid, "custom", 0.0);
458 }
459 } 434 }
460 parts { 435 parts {
461 part { name: "item_clip"; type: RECT; 436 part { name: "item_clip"; type: RECT;
@@ -520,19 +495,7 @@ group { name: "e/modules/ibox/icon_overlay";
520 rel2.to: "background"; 495 rel2.to: "background";
521 } 496 }
522 } 497 }
523 part { name: "clipper"; type: RECT;
524 description{ state: "default" 0.0;
525 rel1.to: "bevel";
526 rel2.to: "bevel";
527 color: 255 255 255 0;
528 }
529 description{ state: "visible" 0.0;
530 inherit: "default" 0.0;
531 color: 255 255 255 255;
532 }
533 }
534 part { name: "bevel"; mouse_events: 0; 498 part { name: "bevel"; mouse_events: 0;
535 clip_to: "clipper";
536 description { state: "default" 0.0; 499 description { state: "default" 0.0;
537 rel1.offset: -10 -6; 500 rel1.offset: -10 -6;
538 rel1.to: "e.text.label"; 501 rel1.to: "e.text.label";
@@ -542,29 +505,47 @@ group { name: "e/modules/ibox/icon_overlay";
542 image.border: 15 15 15 15; 505 image.border: 15 15 15 15;
543 fill.smooth: 0; 506 fill.smooth: 0;
544 fixed: 1 1; 507 fixed: 1 1;
508 color: 255 255 255 0;
509 visible: 0;
510 }
511 description { state: "visible" 0.0;
512 inherit: "default" 0.0;
513 color: 255 255 255 255;
514 visible: 1;
545 } 515 }
546 } 516 }
547 part { name: "spacer"; type: SPACER; 517 text { name: "spacer";
548 description { state: "default" 0.0; 518 effect: SHADOW BOTTOM;
549 rel1.relative: 0.0 1.0; 519 scale: 1;
550 rel2.relative: 1.0 1.0; 520 desc { color: 0 0 0 0;
521 rel1.relative: 1 0;
522 rel2.relative: 0 1;
523 text {
524 source: "e.text.label";
525 text_source: "e.text.label";
526 }
527 link.base: "e,origin,center" "e";
528 link.transition: SINUSOIDAL 0.1 CURRENT;
551 } 529 }
552 description { state: "visible" 0.0; 530 desc { "left"; inherit: "default";
553 rel1.relative: 0.0 0.5; 531 align: 0.0 0.5;
554 rel2.relative: 1.0 0.5; 532 link.base: "e,origin,left" "e";
533 link.transition: SINUSOIDAL 0.1 CURRENT;
534 }
535 desc { "right"; inherit: "default";
536 align: 1.0 0.5;
537 link.base: "e,origin,right" "e";
538 link.transition: SINUSOIDAL 0.1 CURRENT;
555 } 539 }
556
557 } 540 }
558 part { name: "e.text.label"; type: TEXT; mouse_events: 0; 541 part { name: "e.text.label"; type: TEXT; mouse_events: 0;
559 effect: SHADOW BOTTOM; 542 effect: SHADOW BOTTOM;
560 scale: 1; 543 scale: 1;
561 clip_to: "clipper";
562 description { state: "default" 0.0; 544 description { state: "default" 0.0;
563 rel1.to: "spacer"; 545 rel1.to_x: "spacer";
564 rel1.relative: 0.0 0.0; 546 rel2.to_x: "spacer";
565 rel2.to: "spacer"; 547 rel1.relative: 0 1;
566 rel2.relative: 1.0 1.0; 548 color_class: "module_label_invisible";
567 color_class: "module_label";
568 color3: 255 255 255 255; 549 color3: 255 255 255 255;
569 text { font: FN; size: 10; 550 text { font: FN; size: 10;
570 min: 1 1; 551 min: 1 1;
@@ -572,7 +553,13 @@ group { name: "e/modules/ibox/icon_overlay";
572 align: 0.5 0.5; 553 align: 0.5 0.5;
573 text_class: "module_normal"; 554 text_class: "module_normal";
574 } 555 }
575 align: 0.5 0.5; 556 }
557 description { state: "visible" 0.0;
558 inherit: "default" 0.0;
559 rel1.relative: 0.0 0.5;
560 rel2.relative: 1.0 0.5;
561 color_class: "module_label";
562 color3: 255 255 255 255;
576 } 563 }
577 } 564 }
578 } 565 }
@@ -612,31 +599,16 @@ group { name: "e/modules/ibox/icon_overlay";
612 signal: "e,action,show,label"; source: "e"; 599 signal: "e,action,show,label"; source: "e";
613 action: STATE_SET "visible" 0.0; 600 action: STATE_SET "visible" 0.0;
614 transition: SINUSOIDAL 0.5; 601 transition: SINUSOIDAL 0.5;
615 target: "spacer"; 602 target: "e.text.label";
616 target: "clipper"; 603 target: "bevel";
617 } 604 }
618 program { 605 program {
619 signal: "e,action,hide,label"; source: "e"; 606 signal: "e,action,hide,label"; source: "e";
620 action: STATE_SET "default" 0.0; 607 action: STATE_SET "default" 0.0;
621 transition: SINUSOIDAL 1.0; 608 transition: SINUSOIDAL 1.0;
622 target: "spacer"; 609 target: "e.text.label";
623 target: "clipper"; 610 target: "bevel";
624 }
625#define ORIGIN_PRO(_NAME,_ID) \
626 program { \
627 signal: "e,origin,"_NAME; source: "e"; \
628 script { \
629 set_int(origin, _ID); \
630 refresh_origin(); \
631 } \
632 } 611 }
633
634 ORIGIN_PRO("bottom", 1)
635 ORIGIN_PRO("top", 2);
636 ORIGIN_PRO("right", 3);
637 ORIGIN_PRO("left", 4);
638
639#undef ORIGIN_PRO
640 program { name: "show_bevel"; 612 program { name: "show_bevel";
641 action: STATE_SET visible 0.0; 613 action: STATE_SET visible 0.0;
642 transition: SINUSOIDAL 1.0; 614 transition: SINUSOIDAL 1.0;