Merge lp:~tintou/switchboard-plug-useraccounts/avatar-no-pixbuf into lp:~elementary-pantheon/switchboard-plug-useraccounts/trunk

Proposed by Corentin Noël
Status: Needs review
Proposed branch: lp:~tintou/switchboard-plug-useraccounts/avatar-no-pixbuf
Merge into: lp:~elementary-pantheon/switchboard-plug-useraccounts/trunk
Diff against target: 20 lines (+4/-6)
1 file modified
src/Widgets/UserItem.vala (+4/-6)
To merge this branch: bzr merge lp:~tintou/switchboard-plug-useraccounts/avatar-no-pixbuf
Reviewer Review Type Date Requested Status
Zisu Andrei (community) Needs Information
Review via email: mp+313496@code.launchpad.net

Description of the change

Don't use pixbufs

To post a comment you must log in.
264. By Corentin Noël

Use the image files directly

Revision history for this message
Zisu Andrei (matzipan) wrote :

1 comment inline

review: Needs Information
Revision history for this message
Corentin Noël (tintou) wrote :

widget.destroy () != delete (widget)
https://valadoc.org/gtk+-3.0/Gtk.Widget.destroy.html
It just kindly ask its container to release it, which results in freeing it.
But you're right for the null-check

Unmerged revisions

264. By Corentin Noël

Use the image files directly

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/UserItem.vala'
2--- src/Widgets/UserItem.vala 2015-10-18 22:49:57 +0000
3+++ src/Widgets/UserItem.vala 2016-12-17 20:43:31 +0000
4@@ -59,12 +59,10 @@
5 }
6
7 public void update_ui () {
8- try {
9- var avatar_pixbuf = new Gdk.Pixbuf.from_file_at_scale (user.get_icon_file (), 32, 32, true);
10- avatar.pixbuf = avatar_pixbuf;
11- } catch (Error e) {
12- avatar.show_default (32);
13- }
14+ var new_avatar = new Granite.Widgets.Avatar.from_file (user.get_icon_file (), 32);
15+ grid.attach (new_avatar, 0, 0, 1, 2);
16+ avatar.destroy ();
17+ avatar = new_avatar;
18
19 full_name_label.label = user.get_real_name ();
20 username_label.label = "<span font_size=\"small\">%s</span>".printf (GLib.Markup.escape_text (user.get_user_name ()));

Subscribers

People subscribed via source and target branches

to all changes: