summaryrefslogtreecommitdiff
path: root/data/elementary/themes/edc/netstatus.edc
blob: 53eecc218dce6441c1f753aba913de8732469320 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
group { name: "e/gadget/netstatus/main";
   alias: "e/gadget/netstatus/main_vert";
   image: "netstatus_rx.png" COMP;
   image: "netstatus_tx.png" COMP;
   image: "netstatus_base.png" COMP;
   image: "netstatus_over.png" COMP;
   script {
      public message(Msg_Type:type, id, ...) {
         if ((type == MSG_INT_SET) && (id == 1)) {
            // new rxcur = getarg(2);
            new rxper = getarg(3);
            // new rxmax = getarg(4);
            // new txcur = getarg(5);
            new txper = getarg(6);
            // new txmax = getarg(7);

            new val = rxper + 155;
            if (val == 155) val = 0;
            custom_state(PART:"rx", "default", 0.0);
            set_state_val(PART:"rx", STATE_COLOR, 255, 255, 255, val);
            set_state(PART:"rx", "custom", 0.0);

            val = txper + 155;
            if (val == 155) val = 0;
            custom_state(PART:"tx", "default", 0.0);
            set_state_val(PART:"tx", STATE_COLOR, 255, 255, 255, val);
            set_state(PART:"tx", "custom", 0.0);
         }
      }
   }
   parts {
      part { name: "base";
         description { state: "default" 0.0;
            aspect: 1.0 1.0;
            aspect_preference: BOTH;
            image.normal: "netstatus_base.png";
         }
      }
      part { name: "rx"; type: IMAGE;
          description { state: "default" 0.0;
             rel1.to: "base";
             rel2.to: "base";
             image.normal: "netstatus_rx.png";
          }
      }
      part { name: "tx"; type: IMAGE;
          description { state: "default" 0.0;
             rel1.to: "base";
             rel2.to: "base";
             image.normal: "netstatus_tx.png";
          }
      }
      part { name: "over";
         description { state: "default" 0.0;
            rel1.to: "base";
            rel2.to: "base";
            image.normal: "netstatus_over.png";
         }
      }
   }
}