1 group { name: "elm/label/base/tooltip";
3 style { name: "tooltip_style";
4 base: "font=Sans font_size=8 color=#666 wrap=word";
6 tag: "hilight" "+ font_weight=Bold";
7 tag: "b" "+ font_weight=Bold";
12 part { name: "elm.text";
16 description { state: "default" 0.0;
18 style: "tooltip_style";
26 group { name: "elm/tooltip/base/default";
31 item: "pad_border_x" "10";
32 item: "pad_border_y" "10";
33 item: "hide_timeout" "0.35"; /**< tooltip is hidden after this amount, keep in sync with hide animations */
36 image: "tooltip-base.png" COMP;
37 image: "tooltip-corner-top-left-tip.png" COMP;
38 image: "tooltip-corner-top-right-tip.png" COMP;
39 image: "tooltip-corner-bottom-left-tip.png" COMP;
40 image: "tooltip-corner-bottom-right-tip.png" COMP;
41 image: "tooltip-edge-left-tip.png" COMP;
42 image: "tooltip-edge-right-tip.png" COMP;
43 image: "tooltip-edge-bottom-tip.png" COMP;
44 image: "tooltip-edge-top-tip.png" COMP;
48 set_state(PART:"corner-top-left", "default", 0.0);
49 set_state(PART:"corner-top-right", "default", 0.0);
50 set_state(PART:"corner-bottom-left", "default", 0.0);
51 set_state(PART:"corner-bottom-right", "default", 0.0);
54 set_state(PART:"clipper-edge-left", "default", 0.0);
55 set_state(PART:"clipper-edge-right", "default", 0.0);
56 set_state(PART:"clipper-edge-top", "default", 0.0);
57 set_state(PART:"clipper-edge-bottom", "default", 0.0);
60 show_corner_top_left() {
61 set_state(PART:"corner-top-left", "visible", 0.0);
63 set_state(PART:"corner-top-right", "default", 0.0);
64 set_state(PART:"corner-bottom-left", "default", 0.0);
65 set_state(PART:"corner-bottom-right", "default", 0.0);
68 show_corner_top_right() {
69 set_state(PART:"corner-top-right", "visible", 0.0);
71 set_state(PART:"corner-top-left", "default", 0.0);
72 set_state(PART:"corner-bottom-left", "default", 0.0);
73 set_state(PART:"corner-bottom-right", "default", 0.0);
77 show_corner_bottom_left() {
78 set_state(PART:"corner-bottom-left", "visible", 0.0);
80 set_state(PART:"corner-bottom-right", "default", 0.0);
81 set_state(PART:"corner-top-left", "default", 0.0);
82 set_state(PART:"corner-top-right", "default", 0.0);
85 show_corner_bottom_right() {
86 set_state(PART:"corner-bottom-right", "visible", 0.0);
88 set_state(PART:"corner-bottom-left", "default", 0.0);
89 set_state(PART:"corner-top-left", "default", 0.0);
90 set_state(PART:"corner-top-right", "default", 0.0);
94 show_edge_left(Float:val) {
95 set_state(PART:"clipper-edge-left", "visible", 0.0);
96 set_drag(PART:"edge-drag-left", 0.0, val);
98 set_state(PART:"clipper-edge-right", "default", 0.0);
99 set_state(PART:"clipper-edge-top", "default", 0.0);
100 set_state(PART:"clipper-edge-bottom", "default", 0.0);
103 show_edge_right(Float:val) {
104 set_state(PART:"clipper-edge-right", "visible", 0.0);
105 set_drag(PART:"edge-drag-right", 0.0, val);
107 set_state(PART:"clipper-edge-left", "default", 0.0);
108 set_state(PART:"clipper-edge-top", "default", 0.0);
109 set_state(PART:"clipper-edge-bottom", "default", 0.0);
113 show_edge_top(Float:val) {
114 set_state(PART:"clipper-edge-top", "visible", 0.0);
115 set_drag(PART:"edge-drag-top", val, 0.0);
117 set_state(PART:"clipper-edge-bottom", "default", 0.0);
118 set_state(PART:"clipper-edge-left", "default", 0.0);
119 set_state(PART:"clipper-edge-right", "default", 0.0);
122 show_edge_bottom(Float:val) {
123 set_state(PART:"clipper-edge-bottom", "visible", 0.0);
124 set_drag(PART:"edge-drag-bottom", val, 0.0);
126 set_state(PART:"clipper-edge-top", "default", 0.0);
127 set_state(PART:"clipper-edge-left", "default", 0.0);
128 set_state(PART:"clipper-edge-right", "default", 0.0);
132 public message(Msg_Type:type, id, ...) {
133 if ((type == MSG_FLOAT_SET) && (id == 1)) {
134 new Float:x, Float:y;
141 if (y < 0.0) show_corner_top_left();
142 else if (y > 1.0) show_corner_bottom_left();
143 else show_edge_left(y);
147 if (y < 0.0) show_corner_top_right();
148 else if (y > 1.0) show_corner_bottom_right();
149 else show_edge_right(y);
153 if (y < 0.0) show_edge_top(x);
154 else if (y > 1.0) show_edge_bottom(x);
165 part { name: "clipper";
167 description { state: "default" 0.0;
168 color: 255 255 255 0;
169 rel1.to: "elm.swallow.content";
170 rel1.offset: -64 -64;
171 rel2.to: "elm.swallow.content";
174 description { state: "visible" 0.0;
175 inherit: "default" 0.0;
176 color: 255 255 255 255;
182 description { state: "default" 0.0;
185 to: "elm.swallow.content";
189 to: "elm.swallow.content";
193 normal: "tooltip-base.png";
200 #define TT_CORNER(name_, rx, ry, ax, ay, ox, oy) \
201 part { name: "corner-"name_; \
204 clip_to: "clipper"; \
205 description { state: "default" 0.0; \
206 color: 255 255 255 0; \
215 to: "elm.swallow.content"; \
220 to: "elm.swallow.content"; \
222 image.normal: "tooltip-corner-"name_"-tip.png"; \
224 description { state: "visible" 0.0; \
225 inherit: "default" 0.0; \
226 color: 255 255 255 255; \
230 TT_CORNER("top-left", 0, 0, 1, 1, 4, 4);
231 TT_CORNER("top-right", 1, 0, 0, 1, -5, 4);
232 TT_CORNER("bottom-left", 0, 1, 1, 0, 4, -5);
233 TT_CORNER("bottom-right", 1, 1, 0, 0, -5, -5);
236 #define TT_EDGE_VERT(name_, rx, ax, ox) \
237 part { name: "clipper-edge-"name_; \
239 clip_to: "clipper"; \
240 description { state: "default" 0.0; \
241 color: 255 255 255 0; \
249 to: "elm.swallow.content"; \
254 to: "elm.swallow.content"; \
257 description { state: "visible" 0.0; \
258 inherit: "default" 0.0; \
259 color: 255 255 255 255; \
263 part { name: "edge-area-"name_; \
266 clip_to: "clipper-edge-"name_; \
267 description { state: "default" 0.0; \
275 to: "elm.swallow.content"; \
280 to: "elm.swallow.content"; \
284 part { name: "edge-drag-"name_; \
287 clip_to: "clipper-edge-"name_; \
291 confine: "edge-area-"name_; \
293 description { state: "default" 0.0; \
296 rel1.to: "edge-area-"name_; \
297 rel2.to: "edge-area-"name_; \
300 part { name: "edge-img-"name_; \
303 clip_to: "clipper-edge-"name_; \
304 description { state: "default" 0.0; \
309 rel1.to: "edge-drag-"name_; \
310 rel2.to: "edge-drag-"name_; \
311 image.normal: "tooltip-edge-"name_"-tip.png"; \
314 TT_EDGE_VERT("left", 0, 1, -2);
315 TT_EDGE_VERT("right", 1, 0, 1);
318 #define TT_EDGE_HORIZ(name_, ry, ay, oy) \
319 part { name: "clipper-edge-"name_; \
321 clip_to: "clipper"; \
322 description { state: "default" 0.0; \
323 color: 255 255 255 0; \
331 to: "elm.swallow.content"; \
336 to: "elm.swallow.content"; \
339 description { state: "visible" 0.0; \
340 inherit: "default" 0.0; \
341 color: 255 255 255 255; \
345 part { name: "edge-area-"name_; \
348 clip_to: "clipper-edge-"name_; \
349 description { state: "default" 0.0; \
357 to: "elm.swallow.content"; \
362 to: "elm.swallow.content"; \
366 part { name: "edge-drag-"name_; \
369 clip_to: "clipper-edge-"name_; \
373 confine: "edge-area-"name_; \
375 description { state: "default" 0.0; \
378 rel1.to: "edge-area-"name_; \
379 rel2.to: "edge-area-"name_; \
382 part { name: "edge-img-"name_; \
385 clip_to: "clipper-edge-"name_; \
386 description { state: "default" 0.0; \
391 rel1.to: "edge-drag-"name_; \
392 rel2.to: "edge-drag-"name_; \
393 image.normal: "tooltip-edge-"name_"-tip.png"; \
396 TT_EDGE_HORIZ("top", 0, 1, -2);
397 TT_EDGE_HORIZ("bottom", 1, 0, 1);
400 part { name: "clipper_content";
402 description { state: "default" 0.0;
403 color: 255 255 255 0;
404 rel1.to: "elm.swallow.content";
405 rel1.offset: -64 -64;
406 rel2.to: "elm.swallow.content";
409 description { state: "visible" 0.0;
410 inherit: "default" 0.0;
411 color: 255 255 255 255;
414 part { name: "elm.swallow.content";
416 clip_to: "clipper_content";
417 description { state: "default" 0.0; }
422 signal: "elm,action,show";
434 action: STATE_SET "visible" 0.0;
435 transition: LINEAR 0.15;
441 action: STATE_SET "visible" 0.0;
442 transition: LINEAR 0.15;
443 target: "clipper_content";
448 signal: "elm,action,hide";
467 action: STATE_SET "default" 0.0;
468 transition: LINEAR 0.1;
469 target: "clipper_content";
474 action: STATE_SET "default" 0.0;
475 transition: LINEAR 0.1;
481 group { name: "elm/tooltip/base/transparent";
485 item: "transparent" "enabled";
488 part { name: "elm.swallow.content";
492 description { state: "default" 0.0; }
497 ///////////////////////////////////////////////////////////////////////////////