Status: | Needs review |
---|---|
Proposed branch: | lp:~davysson/daily/animations |
Merge into: | lp:daily |
Diff against target: |
800 lines (+352/-229) 5 files modified
src/Content.vala (+85/-83) src/Main.vala (+179/-58) src/Widgets/ContentView.vala (+52/-52) src/Widgets/GridView.vala (+6/-6) src/Widgets/ListView.vala (+30/-30) |
To merge this branch: | bzr merge lp:~davysson/daily/animations |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kenneth Malac | Pending | ||
Review via email: mp+113820@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeFiles/CMakeDetermineCompilerABI_C.bin' (properties changed: +x to -x) |
2 | === modified file 'CMakeFiles/CMakeDetermineCompilerABI_CXX.bin' (properties changed: +x to -x) |
3 | === modified file 'CMakeFiles/CompilerIdC/a.out' (properties changed: +x to -x) |
4 | === modified file 'CMakeFiles/CompilerIdCXX/a.out' (properties changed: +x to -x) |
5 | === modified file 'cmake/CMakeFiles/CMakeDetermineCompilerABI_C.bin' (properties changed: +x to -x) |
6 | === modified file 'cmake/CMakeFiles/CMakeDetermineCompilerABI_CXX.bin' (properties changed: +x to -x) |
7 | === modified file 'cmake/CMakeFiles/CompilerIdC/a.out' (properties changed: +x to -x) |
8 | === modified file 'cmake/CMakeFiles/CompilerIdCXX/a.out' (properties changed: +x to -x) |
9 | === modified file 'src/Content.vala' (properties changed: +x to -x) |
10 | --- src/Content.vala 2012-07-06 02:56:57 +0000 |
11 | +++ src/Content.vala 2012-07-07 04:41:20 +0000 |
12 | @@ -14,15 +14,15 @@ |
13 | insert (0, c); |
14 | added (); |
15 | c.clicked.connect ((item) => { |
16 | - active_changed(index_of (c)); |
17 | - }); |
18 | + active_changed(index_of (c)); |
19 | + }); |
20 | } |
21 | |
22 | public void on_click (){ |
23 | - |
24 | - |
25 | - |
26 | - } |
27 | + |
28 | + |
29 | + |
30 | + } |
31 | |
32 | } |
33 | |
34 | @@ -68,33 +68,33 @@ |
35 | |
36 | try { |
37 | if (image_path != null){ |
38 | - |
39 | - var img = new Gdk.Pixbuf.from_file (image_path); |
40 | - var scale = img.scale_simple (128, 128, Gdk.InterpType.BILINEAR); |
41 | - scale.composite (pix, 5, 5, 118, 118, 0, 0, 1, 1, Gdk.InterpType.BILINEAR, 255); |
42 | - } |
43 | - |
44 | + |
45 | + var img = new Gdk.Pixbuf.from_file (image_path); |
46 | + var scale = img.scale_simple (128, 128, Gdk.InterpType.BILINEAR); |
47 | + scale.composite (pix, 5, 5, 118, 118, 0, 0, 1, 1, Gdk.InterpType.BILINEAR, 255); |
48 | + } |
49 | + |
50 | image_without_new = new Image.from_pixbuf (pix.copy ()); |
51 | |
52 | } catch (Error e){ warning (e.message); } |
53 | |
54 | try { |
55 | - |
56 | - Gdk.Pixbuf img = new Gdk.Pixbuf.from_file (build_pkg_data_dir+"/images/new.png"); |
57 | - img.composite (pix, 3, 3, 37, 37, 0, 0, 1, 1, Gdk.InterpType.BILINEAR, 255); |
58 | - image_with_new = new Image.from_pixbuf (pix); |
59 | - |
60 | - } catch (Error e){ warning (e.message); } |
61 | - |
62 | + |
63 | + Gdk.Pixbuf img = new Gdk.Pixbuf.from_file (build_pkg_data_dir+"/images/new.png"); |
64 | + img.composite (pix, 3, 3, 37, 37, 0, 0, 1, 1, Gdk.InterpType.BILINEAR, 255); |
65 | + image_with_new = new Image.from_pixbuf (pix); |
66 | + |
67 | + } catch (Error e){ warning (e.message); } |
68 | + |
69 | if (with_new){ |
70 | - |
71 | - return image_with_new; |
72 | - |
73 | - } else { |
74 | - |
75 | - return image_without_new; |
76 | - |
77 | - } |
78 | + |
79 | + return image_with_new; |
80 | + |
81 | + } else { |
82 | + |
83 | + return image_without_new; |
84 | + |
85 | + } |
86 | |
87 | } |
88 | |
89 | @@ -103,28 +103,28 @@ |
90 | return "by " + author + " in " + site + " on posted " + date; |
91 | |
92 | } |
93 | - |
94 | - private Box build_grid_box (){ |
95 | - |
96 | - var image = create_image (image_path); |
97 | - bool first_update = true; |
98 | - update_image.connect (() => { |
99 | - if (first_update){ |
100 | - image.set_from_pixbuf (create_image(image_path, false).pixbuf); |
101 | - first_update = false; |
102 | - } |
103 | - }); |
104 | + |
105 | + private Box build_grid_box (){ |
106 | + |
107 | + var image = create_image (image_path); |
108 | + bool first_update = true; |
109 | + update_image.connect (() => { |
110 | + if (first_update){ |
111 | + image.set_from_pixbuf (create_image(image_path, false).pixbuf); |
112 | + first_update = false; |
113 | + } |
114 | + }); |
115 | |
116 | var image_event = new EventBox (); |
117 | image_event.visible_window = false; |
118 | image_event.border_width = 0; |
119 | image_event.add (image); |
120 | image_event.button_press_event.connect (() => { |
121 | - update_image (); |
122 | - clicked (); |
123 | - return false; |
124 | - }); |
125 | - |
126 | + update_image (); |
127 | + clicked (); |
128 | + return false; |
129 | + }); |
130 | + |
131 | string css_style = " * { font-size: 10 } "; |
132 | |
133 | var css = new CssProvider (); |
134 | @@ -146,28 +146,28 @@ |
135 | main_box.pack_start (title, false); |
136 | |
137 | return main_box; |
138 | - |
139 | - } |
140 | - |
141 | - private Box build_left_list_box (){ |
142 | - |
143 | - var image = create_image (image_path); |
144 | - bool first_update = true; |
145 | - update_image.connect (() => { |
146 | - if (first_update){ |
147 | - image.set_from_pixbuf (create_image(image_path, false).pixbuf); |
148 | - first_update = false; |
149 | - } |
150 | - }); |
151 | + |
152 | + } |
153 | + |
154 | + private Box build_left_list_box (){ |
155 | + |
156 | + var image = create_image (image_path); |
157 | + bool first_update = true; |
158 | + update_image.connect (() => { |
159 | + if (first_update){ |
160 | + image.set_from_pixbuf (create_image(image_path, false).pixbuf); |
161 | + first_update = false; |
162 | + } |
163 | + }); |
164 | |
165 | var image_event = new EventBox (); |
166 | image_event.visible_window = false; |
167 | image_event.add (image); |
168 | image_event.button_press_event.connect (() => { |
169 | - update_image (); |
170 | - clicked (); |
171 | - return false; |
172 | - }); |
173 | + update_image (); |
174 | + clicked (); |
175 | + return false; |
176 | + }); |
177 | |
178 | var main_box = new Box (Orientation.VERTICAL, 0); |
179 | main_box.halign = Align.START; |
180 | @@ -188,9 +188,6 @@ |
181 | title.get_style_context ().add_class ("title"); |
182 | title.get_style_context ().add_provider (css, 10000); |
183 | |
184 | - var title_event = new EventBox (); |
185 | - title_event.add (title); |
186 | - |
187 | var post_info = new Label (post_info ()); |
188 | post_info.set_alignment (0, 0); |
189 | post_info.get_style_context ().add_class ("post_info"); |
190 | @@ -209,17 +206,17 @@ |
191 | content_box.pack_start (image_event); |
192 | content_box.pack_start (content); |
193 | |
194 | - main_box.pack_start (title_event, false); |
195 | + main_box.pack_start (title, false); |
196 | main_box.pack_start (post_info, false); |
197 | main_box.pack_start (content_box, false); |
198 | |
199 | return main_box; |
200 | - |
201 | - } |
202 | - |
203 | - private Box build_right_list_box (){ |
204 | - |
205 | - var main_box = new Box (Orientation.VERTICAL, 0); |
206 | + |
207 | + } |
208 | + |
209 | + private Box build_right_list_box (){ |
210 | + |
211 | + var main_box = new Box (Orientation.VERTICAL, 0); |
212 | main_box.halign = Align.START; |
213 | main_box.margin_left = 12; |
214 | main_box.margin_right = 12; |
215 | @@ -248,19 +245,24 @@ |
216 | |
217 | main_box.pack_start (title, false); |
218 | main_box.pack_start (content, false); |
219 | - |
220 | - return main_box; |
221 | - |
222 | - } |
223 | - |
224 | - public Gtk.Box build_content_box (){ |
225 | - |
226 | - //not implemented yet. |
227 | - var main_box = new Box (Orientation.HORIZONTAL, 0); |
228 | - |
229 | - return main_box; |
230 | - |
231 | - } |
232 | + |
233 | + return main_box; |
234 | + |
235 | + } |
236 | + |
237 | + public Gtk.Box build_content_box (){ |
238 | + |
239 | + //not implemented yet. |
240 | + var main_box = new Box (Orientation.HORIZONTAL, 0); |
241 | + |
242 | + var label = new Label ("Not Implemented Yet"); |
243 | + label.valign = label.halign = Align.CENTER; |
244 | + |
245 | + main_box.add (label); |
246 | + |
247 | + return main_box; |
248 | + |
249 | + } |
250 | |
251 | } |
252 | |
253 | |
254 | === modified file 'src/Main.vala' (properties changed: +x to -x) |
255 | --- src/Main.vala 2012-07-06 02:56:57 +0000 |
256 | +++ src/Main.vala 2012-07-07 04:41:20 +0000 |
257 | @@ -22,7 +22,7 @@ |
258 | |
259 | public static int main (string[] args) { |
260 | |
261 | - Gtk.init (ref args); |
262 | + GtkClutter.init (ref args); |
263 | return new Application ().run (args); |
264 | |
265 | } |
266 | @@ -102,7 +102,7 @@ |
267 | window.set_default_size(810, 510); |
268 | window.window_position = Gtk.WindowPosition.CENTER; |
269 | window.destroy.connect (Gtk.main_quit); |
270 | - |
271 | + |
272 | var contents = new Content (); |
273 | contents.add (new ContentItem (null, "Game Store Gameolith Expands Horizons, No Longer Linux-Only", "", "", "", "", "")); |
274 | contents.add (new ContentItem (null, "Title", "DavyS", "june 15, 2012", "elementaryOS", "Lorem Ipsum", "")); |
275 | @@ -118,14 +118,6 @@ |
276 | var list_view = new ListView (contents); |
277 | var content_view = new ContentView (contents); |
278 | |
279 | - var notebook = new Gtk.Notebook (); |
280 | - notebook.show_tabs = false; |
281 | - notebook.show_border = false; |
282 | - notebook.append_page (grid_view); |
283 | - notebook.append_page (list_view); |
284 | - notebook.append_page (content_view); |
285 | - notebook.page = notebook.page_num (grid_view); |
286 | - |
287 | var mode_button = new Granite.Widgets.ModeButton (); |
288 | |
289 | mode_button.append_icon ("view-grid-symbolic", Gtk.IconSize.MENU); |
290 | @@ -133,43 +125,11 @@ |
291 | |
292 | mode_button.set_active (0); |
293 | |
294 | - // grid button |
295 | - ((Gtk.ToggleButton) mode_button.get_children ().nth_data (0)).clicked.connect (() => { |
296 | - notebook.page = notebook.page_num (grid_view); |
297 | - }); |
298 | - |
299 | - // list button |
300 | - ((Gtk.ToggleButton) mode_button.get_children ().nth_data (1)).clicked.connect (() => { |
301 | - notebook.page = notebook.page_num (list_view); |
302 | - }); |
303 | + //buttons |
304 | |
305 | var add = new Gtk.Button (); |
306 | add.add (new Gtk.Image.from_icon_name ("list-add-symbolic", Gtk.IconSize.MENU)); |
307 | - add.clicked.connect (() => { |
308 | - |
309 | - //need fix multiple instances!! |
310 | - |
311 | - var pop = new Daily.Widgets.PopOver (); |
312 | - var content = pop.get_content_area (); |
313 | - content.set_size_request (300, 200); |
314 | - |
315 | - var source = new Gtk.Label ("Feed Source"); |
316 | - //source.valign = source.halign = Gtk.Align.START; |
317 | - |
318 | - var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); |
319 | - |
320 | - var add_label = new Gtk.Label ("Add Link:"); |
321 | - var add_entry = new Gtk.Entry (); |
322 | - |
323 | - hbox.pack_start (add_label, false); |
324 | - hbox.pack_start (add_entry); |
325 | - |
326 | - content.pack_start (source, false); |
327 | - content.pack_start (hbox, false); |
328 | - pop.move_to_widget (add); |
329 | - pop.show_all (); |
330 | - |
331 | - }); |
332 | + |
333 | |
334 | var about = new Gtk.Button (); |
335 | about.add (new Gtk.Image.from_icon_name ("dialog-information-symbolic", Gtk.IconSize.MENU)); |
336 | @@ -193,13 +153,7 @@ |
337 | |
338 | string current_url = ""; |
339 | |
340 | - open.clicked.connect (() => { |
341 | - |
342 | - try{ |
343 | - Gtk.show_uri (null, current_url, Gdk.CURRENT_TIME); |
344 | - } catch (Error e){ warning (e.message); }; |
345 | - |
346 | - }); |
347 | + //toolbar |
348 | |
349 | var control_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); |
350 | control_box.pack_start (prev, false); |
351 | @@ -223,18 +177,108 @@ |
352 | hbox2.pack_start (about, false); |
353 | hbox2.pack_start (add, false); |
354 | hbox2.pack_end (mode_button, false); |
355 | - |
356 | - var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); |
357 | - box.pack_start (notebook); |
358 | + |
359 | + //Animations |
360 | + |
361 | + //grid clutter embed actor |
362 | + |
363 | + var grid_embed = new GtkClutter.Embed (); |
364 | + var grid_actor = new GtkClutter.Actor.with_contents (grid_view); |
365 | + grid_actor.show_all (); |
366 | + |
367 | + grid_embed.get_stage ().add_child (grid_actor); |
368 | + (grid_embed.get_stage () as Clutter.Stage).use_alpha = true; |
369 | + |
370 | + grid_actor.add_constraint (new Clutter.BindConstraint (grid_embed.get_stage (), |
371 | + Clutter.BindCoordinate.WIDTH, 0)); |
372 | + grid_actor.add_constraint (new Clutter.BindConstraint (grid_embed.get_stage (), |
373 | + Clutter.BindCoordinate.HEIGHT, 0)); |
374 | + |
375 | + //list clutter embed actor |
376 | + |
377 | + var list_embed = new GtkClutter.Embed (); |
378 | + var list_actor = new GtkClutter.Actor.with_contents (list_view); |
379 | + list_actor.show_all (); |
380 | + |
381 | + list_embed.get_stage ().add_child (list_actor); |
382 | + (list_embed.get_stage () as Clutter.Stage).use_alpha = true; |
383 | + |
384 | + list_actor.add_constraint (new Clutter.BindConstraint (list_embed.get_stage (), |
385 | + Clutter.BindCoordinate.WIDTH, 0)); |
386 | + list_actor.add_constraint (new Clutter.BindConstraint (list_embed.get_stage (), |
387 | + Clutter.BindCoordinate.HEIGHT, 0)); |
388 | + |
389 | + list_actor.x = list_embed.get_stage ().width; |
390 | + list_actor.opacity = 0; |
391 | + |
392 | + //content clutter embed actor |
393 | + |
394 | + var content_embed = new GtkClutter.Embed (); |
395 | + var content_actor = new GtkClutter.Actor.with_contents (content_view); |
396 | + content_actor.show_all (); |
397 | + |
398 | + content_embed.get_stage ().add_child (content_actor); |
399 | + (content_embed.get_stage () as Clutter.Stage).use_alpha = true; |
400 | + |
401 | + content_actor.add_constraint (new Clutter.BindConstraint (content_embed.get_stage (), |
402 | + Clutter.BindCoordinate.WIDTH, 0)); |
403 | + content_actor.add_constraint (new Clutter.BindConstraint (content_embed.get_stage (), |
404 | + Clutter.BindCoordinate.HEIGHT, 0)); |
405 | + |
406 | + content_actor.opacity = 0; |
407 | + |
408 | + //fix background color |
409 | + |
410 | + //(grid_embed.get_stage () as Clutter.Stage).set_color ({222, 222, 222, 255}); |
411 | + //(list_embed.get_stage () as Clutter.Stage).set_color ({222, 222, 222, 255}); |
412 | + //(content_embed.get_stage () as Clutter.Stage).set_color ({240, 240, 240, 255}); |
413 | + |
414 | + //notebook |
415 | + |
416 | + var notebook = new Gtk.Notebook (); |
417 | + notebook.show_border = false; |
418 | + notebook.show_tabs = false; |
419 | + notebook.append_page (grid_embed, null); |
420 | + notebook.append_page (list_embed, null); |
421 | + notebook.append_page (content_embed, null); |
422 | + |
423 | + notebook.page = notebook.page_num (list_embed); |
424 | + |
425 | + var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); |
426 | + |
427 | + box.pack_start (notebook); |
428 | box.pack_end (hbox2, false); |
429 | - |
430 | - int previous_page = 0; |
431 | + |
432 | + window.add (box); |
433 | + |
434 | + //Events |
435 | + |
436 | + int previous_page = 0; |
437 | |
438 | contents.active_changed.connect ((id) => { |
439 | content_view.page = content_view.page_num (contents.get (id).content_box); |
440 | previous_page = notebook.page; |
441 | - notebook.page = notebook.page_num (content_view); |
442 | |
443 | + if (notebook.page == notebook.page_num (grid_embed)){ |
444 | + |
445 | + grid_actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity: 0).completed.connect (() => { |
446 | + |
447 | + notebook.page = notebook.page_num (content_embed); |
448 | + content_actor.animate (Clutter.AnimationMode.EASE_IN_QUAD, 400, opacity: 255); |
449 | + |
450 | + }); |
451 | + |
452 | + } else if (notebook.page == notebook.page_num (list_embed)) { |
453 | + |
454 | + list_actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity: 0).completed.connect (() => { |
455 | + |
456 | + notebook.page = notebook.page_num (content_embed); |
457 | + content_actor.animate (Clutter.AnimationMode.EASE_IN_QUAD, 400, opacity: 255); |
458 | + |
459 | + }); |
460 | + |
461 | + } |
462 | + |
463 | current_url = contents.get (id).url; |
464 | |
465 | box.remove (hbox2); |
466 | @@ -242,14 +286,91 @@ |
467 | box.show_all (); |
468 | }); |
469 | |
470 | + |
471 | back.clicked.connect (() => { |
472 | + |
473 | + content_actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity: 0).completed.connect (() => { |
474 | + |
475 | + notebook.page = previous_page; |
476 | + if (previous_page == notebook.page_num (grid_embed)){ |
477 | + |
478 | + grid_actor.animate (Clutter.AnimationMode.EASE_IN_QUAD, 400, opacity: 255); |
479 | + |
480 | + } else if (previous_page == notebook.page_num (list_embed)){ |
481 | + |
482 | + list_actor.animate (Clutter.AnimationMode.EASE_IN_QUAD, 400, opacity: 255); |
483 | + |
484 | + } |
485 | + |
486 | + }); |
487 | + |
488 | notebook.page = previous_page; |
489 | box.remove (hbox1); |
490 | box.pack_end (hbox2, false); |
491 | box.show_all (); |
492 | }); |
493 | |
494 | - window.add (box); |
495 | + // grid button, switch to grid |
496 | + (mode_button.get_children ().nth_data (0) as Gtk.ToggleButton).toggled.connect (() => { |
497 | + if ((mode_button.get_children ().nth_data (0) as Gtk.ToggleButton).active){ |
498 | + |
499 | + list_actor.animate (Clutter.AnimationMode.EASE_IN_QUAD, 400, x:grid_embed.get_stage ().width, |
500 | + opacity:0).completed.connect (() => { |
501 | + |
502 | + notebook.page = notebook.page_num (grid_embed); |
503 | + grid_actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, x:0.0f, opacity:255); |
504 | + }); |
505 | + |
506 | + } |
507 | + }); |
508 | + |
509 | + // list button, switch to list |
510 | + (mode_button.get_children ().nth_data (1) as Gtk.ToggleButton).toggled.connect (() => { |
511 | + if ((mode_button.get_children ().nth_data (1) as Gtk.ToggleButton).active){ |
512 | + |
513 | + grid_actor.animate (Clutter.AnimationMode.EASE_IN_QUAD, 400, x:-grid_embed.get_stage ().width, |
514 | + opacity:0).completed.connect (() => { |
515 | + |
516 | + notebook.page = notebook.page_num (list_embed); |
517 | + list_actor.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, x:0.0f, opacity:255); |
518 | + }); |
519 | + } |
520 | + }); |
521 | + |
522 | + add.clicked.connect (() => { |
523 | + |
524 | + //need fix multiple instances!! |
525 | + |
526 | + var pop = new Daily.Widgets.PopOver (); |
527 | + var content = pop.get_content_area (); |
528 | + content.set_size_request (300, 200); |
529 | + |
530 | + var source = new Gtk.Label ("Feed Source"); |
531 | + //source.valign = source.halign = Gtk.Align.START; |
532 | + |
533 | + var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); |
534 | + |
535 | + var add_label = new Gtk.Label ("Add Link:"); |
536 | + var add_entry = new Gtk.Entry (); |
537 | + |
538 | + hbox.pack_start (add_label, false); |
539 | + hbox.pack_start (add_entry); |
540 | + |
541 | + content.pack_start (source, false); |
542 | + content.pack_start (hbox, false); |
543 | + pop.move_to_widget (add); |
544 | + pop.show_all (); |
545 | + |
546 | + }); |
547 | + |
548 | + |
549 | + open.clicked.connect (() => { |
550 | + |
551 | + try{ |
552 | + Gtk.show_uri (null, current_url, Gdk.CURRENT_TIME); |
553 | + } catch (Error e){ warning (e.message); }; |
554 | + |
555 | + }); |
556 | |
557 | } |
558 | } |
559 | |
560 | === modified file 'src/Widgets/ContentView.vala' (properties changed: +x to -x) |
561 | --- src/Widgets/ContentView.vala 2012-07-05 04:39:46 +0000 |
562 | +++ src/Widgets/ContentView.vala 2012-07-07 04:41:20 +0000 |
563 | @@ -25,60 +25,60 @@ |
564 | using Granite.Widgets; |
565 | |
566 | namespace Daily.Widgets { |
567 | - |
568 | - public class ContentView : Notebook { |
569 | - |
570 | - private Content c; |
571 | - |
572 | - public ContentView (Content content){ |
573 | - |
574 | - c = content; |
575 | - c.added.connect (update); |
576 | - c.removed.connect (update); |
577 | - show_border = false; |
578 | - show_tabs = false; |
579 | - |
580 | - update (); |
581 | - } |
582 | - |
583 | - public void update (){ |
584 | - |
585 | - clear (); |
586 | - |
587 | - if (!c.is_empty){ |
588 | - |
589 | - int last = c.index_of (c.last ()); |
590 | - |
591 | - for (int i = 0; i <= last; i++){ |
592 | + |
593 | + public class ContentView : Notebook { |
594 | + |
595 | + private Content c; |
596 | + |
597 | + public ContentView (Content content){ |
598 | + |
599 | + c = content; |
600 | + c.added.connect (update); |
601 | + c.removed.connect (update); |
602 | + show_border = false; |
603 | + show_tabs = false; |
604 | + |
605 | + update (); |
606 | + } |
607 | + |
608 | + public void update (){ |
609 | + |
610 | + clear (); |
611 | + |
612 | + if (!c.is_empty){ |
613 | + |
614 | + int last = c.index_of (c.last ()); |
615 | + |
616 | + for (int i = 0; i <= last; i++){ |
617 | |
618 | add (c.get (i)); |
619 | |
620 | } |
621 | - |
622 | - } |
623 | - |
624 | - } |
625 | - |
626 | - public new void add (ContentItem c){ |
627 | - |
628 | - append_page (c.content_box, null); |
629 | - |
630 | - } |
631 | - |
632 | - public void clear (){ |
633 | - |
634 | - this.foreach ((widget) => { |
635 | - remove (widget); |
636 | - }); |
637 | - |
638 | - } |
639 | - |
640 | - public void on_window_resized (){ |
641 | - |
642 | - |
643 | - |
644 | - } |
645 | - |
646 | - } |
647 | - |
648 | + |
649 | + } |
650 | + |
651 | + } |
652 | + |
653 | + public new void add (ContentItem c){ |
654 | + |
655 | + append_page (c.content_box, null); |
656 | + |
657 | + } |
658 | + |
659 | + public void clear (){ |
660 | + |
661 | + this.foreach ((widget) => { |
662 | + remove (widget); |
663 | + }); |
664 | + |
665 | + } |
666 | + |
667 | + public void on_window_resized (){ |
668 | + |
669 | + |
670 | + |
671 | + } |
672 | + |
673 | + } |
674 | + |
675 | } |
676 | |
677 | === modified file 'src/Widgets/GridView.vala' (properties changed: +x to -x) |
678 | --- src/Widgets/GridView.vala 2012-07-05 04:39:46 +0000 |
679 | +++ src/Widgets/GridView.vala 2012-07-07 04:41:20 +0000 |
680 | @@ -38,14 +38,14 @@ |
681 | this.row_homogeneous = true; |
682 | this.column_spacing = 48; |
683 | this.row_spacing = 10; |
684 | - this.border_width = 40; |
685 | + this.border_width = 30; |
686 | this.valign = Gtk.Align.END; |
687 | this.halign = Gtk.Align.CENTER; |
688 | c = content; |
689 | c.added.connect (update); |
690 | c.removed.connect (update); |
691 | |
692 | - update (); |
693 | + update (); |
694 | |
695 | } |
696 | |
697 | @@ -89,10 +89,10 @@ |
698 | } |
699 | |
700 | public void on_window_resized (){ |
701 | - |
702 | - |
703 | - |
704 | - } |
705 | + |
706 | + |
707 | + |
708 | + } |
709 | } |
710 | |
711 | } |
712 | |
713 | === modified file 'src/Widgets/ListView.vala' (properties changed: +x to -x) |
714 | --- src/Widgets/ListView.vala 2012-07-05 04:39:46 +0000 |
715 | +++ src/Widgets/ListView.vala 2012-07-07 04:41:20 +0000 |
716 | @@ -52,20 +52,20 @@ |
717 | pack_end (right_container, false); |
718 | |
719 | |
720 | - update (); |
721 | + update (); |
722 | |
723 | } |
724 | |
725 | private new void add (ContentItem c, int pos){ |
726 | |
727 | if (pos == 0 || pos == 1){ |
728 | - left_container.pack_start (c.left_list_box); |
729 | - |
730 | - } else if (pos == 2 || pos == 3){ |
731 | - |
732 | - right_container.pack_start (c.right_list_box); |
733 | - |
734 | - } |
735 | + left_container.pack_start (c.left_list_box); |
736 | + |
737 | + } else if (pos == 2 || pos == 3){ |
738 | + |
739 | + right_container.pack_start (c.right_list_box); |
740 | + |
741 | + } |
742 | |
743 | } |
744 | |
745 | @@ -74,34 +74,34 @@ |
746 | clear (); |
747 | |
748 | if (!c.is_empty){ |
749 | - |
750 | - int last = c.index_of (c.last ()); |
751 | - |
752 | - for (int i = 0; i < 4 && i <= last; i++){ |
753 | - add (c.get (i), i); |
754 | - |
755 | - } |
756 | - |
757 | - } |
758 | + |
759 | + int last = c.index_of (c.last ()); |
760 | + |
761 | + for (int i = 0; i < 4 && i <= last; i++){ |
762 | + add (c.get (i), i); |
763 | + |
764 | + } |
765 | + |
766 | + } |
767 | |
768 | } |
769 | |
770 | public void clear (){ |
771 | - |
772 | - left_container.foreach ((widget) => { |
773 | - left_container.remove (widget); |
774 | - }); |
775 | - right_container.foreach ((widget) => { |
776 | - right_container.remove (widget); |
777 | - }); |
778 | - |
779 | - } |
780 | + |
781 | + left_container.foreach ((widget) => { |
782 | + left_container.remove (widget); |
783 | + }); |
784 | + right_container.foreach ((widget) => { |
785 | + right_container.remove (widget); |
786 | + }); |
787 | + |
788 | + } |
789 | |
790 | public void on_window_resized (){ |
791 | - |
792 | - |
793 | - |
794 | - } |
795 | + |
796 | + |
797 | + |
798 | + } |
799 | |
800 | } |
801 |