diff options
author | David Walter Seikel | 2014-05-12 04:35:32 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-12 04:35:32 +1000 |
commit | 4a180d988d36ee6a7d8a1d4e106b801410a2a05c (patch) | |
tree | 90caec7339191be5dd0d25f3bea0f403f6d0f10e /src | |
parent | Internal and external windows now both use the layout. (diff) | |
download | SledjHamr-4a180d988d36ee6a7d8a1d4e106b801410a2a05c.zip SledjHamr-4a180d988d36ee6a7d8a1d4e106b801410a2a05c.tar.gz SledjHamr-4a180d988d36ee6a7d8a1d4e106b801410a2a05c.tar.bz2 SledjHamr-4a180d988d36ee6a7d8a1d4e106b801410a2a05c.tar.xz |
Fiddle with the winFang title, and white space cleanups on winFang.edc.
Diffstat (limited to 'src')
-rw-r--r-- | src/libraries/winFang.c | 24 | ||||
-rw-r--r-- | src/libraries/winFang.edc | 277 |
2 files changed, 155 insertions, 146 deletions
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index e2dce45..0d1137f 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c | |||
@@ -185,6 +185,8 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
185 | { | 185 | { |
186 | eina_clist_add_head(&parent->winFangs, &result->node); | 186 | eina_clist_add_head(&parent->winFangs, &result->node); |
187 | obj = parent->win; | 187 | obj = parent->win; |
188 | h += 15; | ||
189 | result->h = h; | ||
188 | } | 190 | } |
189 | else | 191 | else |
190 | { | 192 | { |
@@ -199,7 +201,7 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
199 | 201 | ||
200 | snprintf(buf, sizeof(buf), "%s/winFang.edj", elm_app_data_dir_get()); | 202 | snprintf(buf, sizeof(buf), "%s/winFang.edj", elm_app_data_dir_get()); |
201 | result->layout = eo_add(ELM_OBJ_LAYOUT_CLASS, obj, | 203 | result->layout = eo_add(ELM_OBJ_LAYOUT_CLASS, obj, |
202 | evas_obj_size_set(result->w, result->h), | 204 | evas_obj_size_set(w, h), |
203 | evas_obj_position_set(x, y), | 205 | evas_obj_position_set(x, y), |
204 | evas_obj_name_set(WF_LAYOUT), | 206 | evas_obj_name_set(WF_LAYOUT), |
205 | elm_obj_layout_file_set(buf, WF_LAYOUT), | 207 | elm_obj_layout_file_set(buf, WF_LAYOUT), |
@@ -211,7 +213,8 @@ winFang *winFangAdd(winFang *parent, int x, int y, int w, int h, char *title, ch | |||
211 | 213 | ||
212 | if (result->parent) | 214 | if (result->parent) |
213 | { | 215 | { |
214 | result->win = result->layout; | 216 | result->win = result->layout; |
217 | elm_layout_signal_emit(result->layout, "isInternal", "isInternal"); | ||
215 | 218 | ||
216 | // Something to catch clicks on the background, for moving the window. | 219 | // Something to catch clicks on the background, for moving the window. |
217 | // Coz Elm is uncooperative with this sort of thing, so we need to stick in a rectangle. | 220 | // Coz Elm is uncooperative with this sort of thing, so we need to stick in a rectangle. |
@@ -246,9 +249,6 @@ result->win = result->layout; | |||
246 | eo_unref(result->hand[i]); | 249 | eo_unref(result->hand[i]); |
247 | } | 250 | } |
248 | 251 | ||
249 | if (title) | ||
250 | elm_object_part_text_set(result->layout, WF_TITLE, title); | ||
251 | /* | ||
252 | result->title = eo_add(ELM_OBJ_LABEL_CLASS, result->layout, | 252 | result->title = eo_add(ELM_OBJ_LABEL_CLASS, result->layout, |
253 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, 1.0), | 253 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, 1.0), |
254 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 254 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), |
@@ -257,20 +257,8 @@ result->win = result->layout; | |||
257 | elm_object_style_set(result->title, "slide_bounce"); | 257 | elm_object_style_set(result->title, "slide_bounce"); |
258 | snprintf(buf, PATH_MAX, "<b>%s</b>", title); | 258 | snprintf(buf, PATH_MAX, "<b>%s</b>", title); |
259 | elm_object_text_set(result->title, buf); | 259 | elm_object_text_set(result->title, buf); |
260 | elm_box_pack_end(result->box, result->title); | 260 | elm_object_part_content_set(result->layout, WF_TITLE, result->title); |
261 | eo_unref(result->title); | 261 | eo_unref(result->title); |
262 | */ | ||
263 | |||
264 | /* | ||
265 | obj1 = eo_add(ELM_OBJ_SEPARATOR_CLASS, result->layout, | ||
266 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, 1.0), | ||
267 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | ||
268 | elm_obj_separator_horizontal_set(EINA_TRUE), | ||
269 | evas_obj_visibility_set(EINA_TRUE) | ||
270 | ); | ||
271 | elm_box_pack_end(result->box, obj1); | ||
272 | eo_unref(obj1); | ||
273 | */ | ||
274 | } | 262 | } |
275 | 263 | ||
276 | result->grid = eo_add(ELM_OBJ_GRID_CLASS, result->layout, | 264 | result->grid = eo_add(ELM_OBJ_GRID_CLASS, result->layout, |
diff --git a/src/libraries/winFang.edc b/src/libraries/winFang.edc index a7a786c..4b6f05d 100644 --- a/src/libraries/winFang.edc +++ b/src/libraries/winFang.edc | |||
@@ -1,137 +1,158 @@ | |||
1 | // The images we use. | ||
2 | images | 1 | images |
3 | { | 2 | { |
4 | image: "bubble.png" COMP; // COMP means to use lossless compression. | 3 | image: "bubble.png" COMP; // COMP means to use lossless compression. |
5 | image: "bubble_sh.png" COMP; | 4 | image: "bubble_sh.png" COMP; |
6 | image: "logo.png" COMP; | 5 | image: "logo.png" COMP; |
7 | image: "pt.png" COMP; | 6 | image: "pt.png" COMP; |
8 | image: "sky_01.jpg" COMP; | 7 | image: "sky_01.jpg" COMP; |
9 | image: "sky_02.jpg" COMP; | 8 | image: "sky_02.jpg" COMP; |
10 | image: "sky_03.jpg" COMP; | 9 | image: "sky_03.jpg" COMP; |
11 | image: "sky_04.jpg" COMP; | 10 | image: "sky_04.jpg" COMP; |
12 | } | 11 | } |
13 | 12 | ||
14 | collections { | 13 | collections |
15 | 14 | { | |
16 | group { | 15 | group |
17 | name: "winFang/layout"; | 16 | { |
18 | 17 | name: "winFang/layout"; | |
19 | data { | 18 | parts |
20 | item: "title" "<b>Layout based internal window</b>"; | 19 | { |
20 | part | ||
21 | { name: "winFang/background"; | ||
22 | type: IMAGE; | ||
23 | // Ignore mouse events. | ||
24 | mouse_events: 0; | ||
25 | // Each part has one or more descriptions, or states. | ||
26 | // They all have to have at least this default state. | ||
27 | description | ||
28 | { state: "default" 0.0; | ||
29 | // RGBA, so this is purple, and semi transparent. | ||
30 | // color: 50 0 100 100; // pre multiplied R = (r * a) / 255 | ||
31 | color: 126 0 255 100; // r = (R * 255) / a | ||
32 | aspect_preference: HORIZONTAL; | ||
33 | image{normal: "sky_04.jpg";} | ||
34 | } | ||
21 | } | 35 | } |
22 | 36 | ||
23 | parts { | 37 | part |
24 | 38 | { name: "winFang/underlay"; | |
25 | // The first part, the black background RECTangle of the screens. | 39 | type: SWALLOW; |
26 | part | 40 | mouse_events: 1; |
27 | { name: "winFang/background"; | 41 | |
28 | type: IMAGE; | 42 | description |
29 | // Ignore mouse events. | 43 | { state: "default" 0.0; |
30 | mouse_events: 0; | 44 | rel1 |
31 | // Each part has one or more descriptions, or states. | 45 | { |
32 | // They all have to have at least this default state. | 46 | relative: 0.0 0.0; |
33 | description | 47 | to: "winFang/background"; |
34 | { state: "default" 0.0; | 48 | } |
35 | // RGBA, so this is purple, and semi transparent. | 49 | rel2 |
36 | // color: 50 0 100 100; // pre multiplied R = (r * a) / 255 | 50 | { |
37 | color: 126 0 255 100; // r = (R * 255) / a | 51 | relative: 1.0 1.0; |
38 | aspect_preference: HORIZONTAL; | 52 | to: "winFang/background"; |
39 | image { | 53 | } |
40 | normal: "sky_04.jpg"; | 54 | } |
41 | } | 55 | } // winFang/underlay |
42 | } | 56 | |
43 | } | 57 | part |
44 | 58 | { name: "winFang/title"; | |
45 | part { | 59 | type: SWALLOW; |
46 | name: "winFang/underlay"; | 60 | mouse_events: 0; |
47 | type: SWALLOW; | 61 | |
48 | mouse_events: 1; | 62 | description |
49 | 63 | { state: "default" 0.0; | |
50 | description { | 64 | visible: 0; |
51 | state: "default" 0.0; | 65 | } |
52 | 66 | ||
53 | rel1 { | 67 | description |
54 | relative: 0.0 0.0; | 68 | { state: "internal" 0.0; |
55 | to: "winFang/background"; | 69 | inherit: "default" 0; |
56 | } | 70 | visible: 1; |
57 | rel2 { | 71 | rel1 |
58 | relative: 1.0 1.0; | 72 | { |
59 | to: "winFang/background"; | 73 | relative: 0.0 0.0; |
60 | } | 74 | to: "winFang/background"; |
61 | } | 75 | } |
62 | } // winFang/underlay | 76 | rel2 |
63 | 77 | { | |
64 | part { | 78 | relative: 1.0 0.0; |
65 | name: "winFang/title"; | 79 | to: "winFang/background"; |
66 | type: TEXT; | 80 | offset: 0 15; |
67 | mouse_events: 0; | 81 | } |
68 | 82 | } | |
69 | description { | 83 | } |
70 | state: "default" 0.0; | ||
71 | color: 255 255 255 255; | ||
72 | rel1 { | ||
73 | relative: 0.0 0.0; | ||
74 | to: "winFang/background"; | ||
75 | } | ||
76 | rel2 { | ||
77 | relative: 1.0 0.0; | ||
78 | to: "winFang/background"; | ||
79 | offset: 0 15; | ||
80 | } | ||
81 | text { | ||
82 | text: ""; | ||
83 | size: 10; | ||
84 | font: "sans"; | ||
85 | min: 0 1; | ||
86 | max: 0 1; | ||
87 | } | ||
88 | } | ||
89 | } | ||
90 | |||
91 | part { | ||
92 | name: "winFang/box"; | ||
93 | type: BOX; | ||
94 | mouse_events: 1; | ||
95 | |||
96 | description { | ||
97 | state: "default" 0.0; | ||
98 | |||
99 | box { | ||
100 | layout: "vertical"; | ||
101 | } | ||
102 | rel1 { | ||
103 | relative: 0.0 0.0; | ||
104 | to: "winFang/title"; | ||
105 | offset: 0 15; | ||
106 | } | ||
107 | rel2 { | ||
108 | relative: 1.0 1.0; | ||
109 | to: "winFang/background"; | ||
110 | } | ||
111 | } | ||
112 | } // winFang/box | ||
113 | |||
114 | part { | ||
115 | name: "winFang/content"; | ||
116 | type: SWALLOW; | ||
117 | mouse_events: 1; | ||
118 | |||
119 | description { | ||
120 | state: "default" 0.0; | ||
121 | fixed: 1 1; | ||
122 | |||
123 | rel1 { | ||
124 | relative: 0.0 0.0; | ||
125 | to: "winFang/title"; | ||
126 | offset: 0 15; | ||
127 | } | ||
128 | rel2 { | ||
129 | relative: 1.0 1.0; | ||
130 | to: "winFang/background"; | ||
131 | } | ||
132 | } | ||
133 | } // winFang/content | ||
134 | 84 | ||
85 | part | ||
86 | { name: "winFang/box"; | ||
87 | type: BOX; | ||
88 | mouse_events: 1; | ||
89 | |||
90 | description | ||
91 | { | ||
92 | state: "default" 0.0; | ||
93 | box{layout: "vertical";} | ||
94 | rel1 | ||
95 | { | ||
96 | relative: 0.0 0.0; | ||
97 | to: "winFang/background"; | ||
98 | } | ||
99 | rel2 | ||
100 | { | ||
101 | relative: 1.0 1.0; | ||
102 | to: "winFang/background"; | ||
103 | } | ||
104 | } | ||
105 | |||
106 | description | ||
107 | { state: "internal" 0.0; | ||
108 | inherit: "default" 0; | ||
109 | rel1 | ||
110 | { | ||
111 | relative: 0.0 0.0; | ||
112 | to: "winFang/title"; | ||
113 | offset: 0 15; | ||
114 | } | ||
115 | rel2 | ||
116 | { | ||
117 | relative: 1.0 1.0; | ||
118 | to: "winFang/background"; | ||
119 | } | ||
120 | } | ||
121 | } // winFang/box | ||
122 | |||
123 | part | ||
124 | { name: "winFang/content"; | ||
125 | type: SWALLOW; | ||
126 | mouse_events: 1; | ||
127 | |||
128 | description | ||
129 | { state: "default" 0.0; | ||
130 | fixed: 1 1; | ||
131 | rel1 | ||
132 | { | ||
133 | relative: 0.0 0.0; | ||
134 | to: "winFang/box"; | ||
135 | } | ||
136 | rel2 | ||
137 | { | ||
138 | relative: 1.0 1.0; | ||
139 | to: "winFang/box"; | ||
140 | } | ||
141 | } | ||
142 | } // winFang/content | ||
143 | |||
144 | programs | ||
145 | { | ||
146 | program | ||
147 | { name: "isInternal"; | ||
148 | signal: "isInternal"; | ||
149 | source: "isInternal"; | ||
150 | action: STATE_SET "internal" 0.0; | ||
151 | target: "winFang/title"; | ||
152 | target: "winFang/box"; | ||
153 | } | ||
135 | } | 154 | } |
136 | } | 155 | |
156 | } | ||
157 | } | ||
137 | } | 158 | } |