summaryrefslogtreecommitdiff
path: root/data/elementary/themes/edc/netstatus.edc
blob: c4157d4ba85e161dd9978ca2cb203e3aa076cdc4 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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 Float:val = rxper / 100.0;
            custom_state(PART:"rx_clip", "default", 0.0);
            set_state_val(PART:"rx_clip", STATE_REL2, 1.0, val);
            set_state(PART:"rx_clip", "custom", 0.0);

            val = txper / 100.0;
            custom_state(PART:"tx_clip", "default", 0.0);
            set_state_val(PART:"tx_clip", STATE_REL1, 0.0, 1.0 - val);
            set_state(PART:"tx_clip", "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_spacer"; type: SPACER;
         description { state: "default" 0.0;
            rel1.relative: 0.0 0.09;
            rel2.relative: 1.0 0.91;
         }
      }
      part { name: "rx_clip"; type: RECT;
         description { state: "default" 0.0;
            rel1.to: "rx_spacer";
            rel2.to: "rx_spacer";
         }
      }
      part { name: "rx"; type: IMAGE;
         clip_to: "rx_clip";
         description { state: "default" 0.0;
            rel1.to: "base";
            rel2.to: "base";
            image.normal: "netstatus_rx.png";
         }
      }
      part { name: "tx_spacer"; type: SPACER;
         description { state: "default" 0.0;
            rel1.relative: 0.0 0.09;
            rel2.relative: 1.0 0.91;
         }
      }
      part { name: "tx_clip"; type: RECT;
         description { state: "default" 0.0;
            rel1.to: "tx_spacer";
            rel2.to: "tx_spacer";
         }
      }
      part { name: "tx"; type: IMAGE;
         clip_to: "tx_clip";
         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";
         }
      }
   }
}