Merge lp:~bigwhale/gwibber/DMs into lp:gwibber

Proposed by David Klasinc
Status: Merged
Merged at revision: 1265
Proposed branch: lp:~bigwhale/gwibber/DMs
Merge into: lp:gwibber
Diff against target: 103 lines (+41/-8)
1 file modified
libgwibber-gtk/stream-view-tile.vala (+41/-8)
To merge this branch: bzr merge lp:~bigwhale/gwibber/DMs
Reviewer Review Type Date Requested Status
Ken VanDine Approve
Review via email: mp+92848@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Merge conflicts

review: Needs Fixing
Revision history for this message
David Klasinc (bigwhale) wrote :

Merged in the latest trunk and fixed the conflicts.

lp:~bigwhale/gwibber/DMs updated
1190. By David Klasinc

Merged in the latest trunk.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks good now, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgwibber-gtk/stream-view-tile.vala'
2--- libgwibber-gtk/stream-view-tile.vala 2012-02-13 03:43:34 +0000
3+++ libgwibber-gtk/stream-view-tile.vala 2012-02-14 07:52:19 +0000
4@@ -127,7 +127,6 @@
5 _avatar_hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
6 _overlay_avatar_hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
7 _avatar_box.set_size_request (48, 48);
8- _avatar_fixed.add (_avatar_hbox);
9 _avatar_box.add (_avatar_fixed);
10 lalignment.add (_avatar_box);
11
12@@ -479,6 +478,10 @@
13 if (_w is Gtk.Widget)
14 _w.destroy ();
15
16+ foreach (var _w in _avatar_fixed.get_children ())
17+ if (_w is Gtk.Widget)
18+ _w.destroy ();
19+
20 foreach (var _w in comments_box.get_children ())
21 if (_w is Gtk.Widget)
22 _w.destroy ();
23@@ -663,16 +666,41 @@
24 var _avatar_cache_image = utils.avatar_path (_icon_uri);
25 var _overlay_avatar_cache_image = "";
26
27+ if (_stream == "private")
28+ {
29+ if (_from_me)
30+ {
31+ _avatar_fixed.put(_avatar_hbox, 8, 0);
32+ _avatar_fixed.put(_overlay_avatar_hbox, 0, 24);
33+ } else
34+ {
35+ _avatar_fixed.put(_avatar_hbox, 0, 0);
36+ _avatar_fixed.put(_overlay_avatar_hbox, 24, 24);
37+ }
38+ _overlay_avatar_hbox.show ();
39+ _overlay_avatar.show ();
40+ } else {
41+ _avatar_fixed.add (_avatar_hbox);
42+ }
43+
44 if (_avatar_cache_image != null)
45 {
46 _avatar.set_from_file (_avatar_cache_image);
47+ if (_stream == "private")
48+ {
49+ Gdk.Pixbuf a_orig;
50+ Gdk.Pixbuf a_scaled;
51+ a_orig = _avatar.get_pixbuf();
52+ a_scaled = a_orig.scale_simple(40, 40, Gdk.InterpType.BILINEAR);
53+ _avatar.set_from_pixbuf(a_scaled);
54+ }
55 _avatar_hbox.add (_avatar);
56 _avatar_hbox.show ();
57 _avatar.show ();
58 } else
59 {
60 ulong _cache_avatar_id = Timeout.add (200, () => {
61- load_avatar_async.begin (_icon_uri, _avatar_hbox);
62+ load_avatar_async.begin (_icon_uri, _avatar_hbox, false, true);
63 return false;
64 });
65 _to_disconnect.append (_cache_avatar_id);
66@@ -693,10 +721,6 @@
67 scaled = orig.scale_simple(24, 24, Gdk.InterpType.BILINEAR);
68 _overlay_avatar.set_from_pixbuf(scaled);
69 _overlay_avatar_hbox.add (_overlay_avatar);
70-
71- _avatar_fixed.put(_overlay_avatar_hbox, 22, 22);
72- _overlay_avatar_hbox.show ();
73- _overlay_avatar.show ();
74 }
75 catch (Error e)
76 {
77@@ -838,7 +862,11 @@
78 show ();
79 }
80
81- private async void load_avatar_async (string url, Gtk.Box b, bool overlay = false)
82+ private async void load_avatar_async (string url,
83+ Gtk.Box b,
84+ bool overlay = false,
85+ bool private = false
86+ )
87 {
88 string t;
89 var file = File.new_for_uri (url);
90@@ -865,7 +893,12 @@
91 avatar.set_from_pixbuf (scaled);
92 } else
93 {
94- avatar.set_from_pixbuf (pixbuf);
95+ if (private)
96+ {
97+ scaled = pixbuf.scale_simple(40, 40, Gdk.InterpType.BILINEAR);
98+ avatar.set_from_pixbuf (scaled);
99+ } else
100+ avatar.set_from_pixbuf (pixbuf);
101 }
102
103 b.add (avatar);