[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] Pulsing icon with edje



Hi,

I'm playing with edje and try to create an icon which pulses one time
after clicking on it. I found a mouse over pulsing example and tried to
modify it. But it doesn't work correct. Could someone help me to find
the problem?

regards
Andreas

images {
  image, "car_body.png" LOSSY 85;
  image, "cdrom.png" LOSSY 85;
}

collections {
  group {
    name: "main";
    min: 800 600;
    max: 800 600;

    parts {

      part {
        name: "background_image";
        description {
          state: "default" 0.0;
          image {
            normal: "car_body.png";
          }
          fill {
            size {
              relative: 0 0;
              offset:   800 600;
            }
          }
        }
      }

      part {
        name, "icon";
        description {
          state, "default" 0.0;
          min, 0 0;
          max, 64 64;
          color, 255 255 255 255;
          rel1 {
            relative, 0.0 0.0;
            offset, 0.0 0.0;
          }
          rel2 {
            relative, 1.0 1.0;
            offset, 0.0 0.0;
          }
          image {
            normal, "cdrom.png";
          }
        }
        description {
          state, "over" 0.0;
          min, 0 0;
          max, 64 64;
          color, 255 255 255 128;
          rel1 {
            relative, 0.0 0.0;
            offset, 0.0 0.0;
          }
          rel2 {
            relative, 1.0 1.0;
            offset, 0.0 0.0;
          }
          image {
            normal, "cdrom.png";
          }
        }
      }

      part {
        name, "pulser";
        mouse_events, 0;

        description {
          state, "default" 0.0;
          min, 0 0;
          max, 128 128;
          color, 255 255 255 128;
          visible, 0;
          rel1 {
            relative, 0.0 0.0;
            offset, 0.0 0.0;
          }
          rel2 {
            relative, 1.0 1.0;
            offset, 0.0 0.0;
          }
          image {
            normal, "cdrom.png";
          }
        }

        description {
          state, "pulse1" 0.0;
          min, 0 0;
          max, 100 100;
          color, 255 255 255 128;
          visible, 1;
          rel1 {
            relative, 0.0 0.0;
            offset, 0.0 0.0;
          }
          rel2 {
            relative, 1.0 1.0;
            offset, 0.0 0.0;
          }
          image {
            normal, "cdrom.png";
          }
        }

        description {
          state, "pulse2" 0.0;
          min, 0 0;
          max, 128 128;
          color, 255 255 255 0;
          align, 0.5 0.5;
          rel1 {
            relative, -0.5 -0.5;
            offset, 0 0;
          }
          rel2 {
            relative, 1.5 1.5;
            offset, 0 0;
          }
          image {
            normal, "cdrom.png";
          }
        }

      }


      part {
        name, "grabber";
        type, RECT;
        description {
          state, "default" 0.0;
          min, 0 0;
          max, 64 64;
          color, 255 255 255 0;
          rel1 {
            relative, 0.0 0.0;
            offset, 0.0 0.0;
          }
          rel2 {
            relative, 1.0 1.0;
            offset, 0.0 0.0;
          }
        }
      }

    }

    programs {
 
      // pulsing //
      program {
        name, "pulse1";
        //signal, "mouse,in";
        source, "grabber";
        action, STATE_SET "pulse1" 0.0;
        transition, LINEAR 0.01;
        target, "pulser";
      }
      program {
        name, "pulse2";
        action, STATE_SET "pulse2" 0.0;
        transition, SINUSOIDAL 1.0;
        target, "pulser";
        after, "pulse1";
      }
      program {
        name, "pulse3";
        //signal, "mouse,out";
        source, "grabber";
        action, STATE_SET "default" 0.0;
        transition, LINEAR 0.5;
        target, "icon";
        after, "pulse2";
      }

      program {
          name: "down";
          signal: "mouse,down,*";
          source: "grabber";
          //action, SIGNAL_EMIT "foo" "bar";
          action, STATE_SET "pulse1" 0.0;
          target, "pulser";
        }

    }

  }
}