[gnome-control-center/useraccounts-fixups: 1/2] user-accounts: Always generate user avatars
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/useraccounts-fixups: 1/2] user-accounts: Always generate user avatars
- Date: Tue, 11 Feb 2020 13:17:31 +0000 (UTC)
commit 033bee869171fec2c95334d6940597bbe7e23c0c
Author: Felipe Borges <felipeborges gnome org>
Date: Tue Feb 11 14:14:38 2020 +0100
user-accounts: Always generate user avatars
Never fallback to default-user avatar icons.
See #859
panels/user-accounts/cc-avatar-chooser.c | 1 -
panels/user-accounts/cc-avatar-chooser.h | 2 ++
panels/user-accounts/cc-user-image.c | 16 ++++------------
3 files changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/panels/user-accounts/cc-avatar-chooser.c b/panels/user-accounts/cc-avatar-chooser.c
index 221e2d8c9..70346ca49 100644
--- a/panels/user-accounts/cc-avatar-chooser.c
+++ b/panels/user-accounts/cc-avatar-chooser.c
@@ -42,7 +42,6 @@
#include "user-utils.h"
#define ROW_SPAN 5
-#define AVATAR_CHOOSER_PIXEL_SIZE 80
#define PIXEL_SIZE 512
struct _CcAvatarChooser {
diff --git a/panels/user-accounts/cc-avatar-chooser.h b/panels/user-accounts/cc-avatar-chooser.h
index 56a1699fe..1479c675e 100644
--- a/panels/user-accounts/cc-avatar-chooser.h
+++ b/panels/user-accounts/cc-avatar-chooser.h
@@ -23,6 +23,8 @@
#include <gtk/gtk.h>
#include <act/act.h>
+#define AVATAR_CHOOSER_PIXEL_SIZE 80
+
G_BEGIN_DECLS
#define CC_TYPE_AVATAR_CHOOSER (cc_avatar_chooser_get_type())
diff --git a/panels/user-accounts/cc-user-image.c b/panels/user-accounts/cc-user-image.c
index 26a430d44..28f964623 100644
--- a/panels/user-accounts/cc-user-image.c
+++ b/panels/user-accounts/cc-user-image.c
@@ -22,6 +22,7 @@
#include <act/act.h>
#include <sys/stat.h>
+#include "cc-avatar-chooser.h"
#include "user-utils.h"
struct _CcUserImage {
@@ -39,7 +40,6 @@ render_user_icon (ActUser *user,
{
g_autoptr(GdkPixbuf) source_pixbuf = NULL;
GdkPixbuf *pixbuf = NULL;
- GError *error;
const gchar *icon_file;
cairo_surface_t *surface = NULL;
@@ -61,17 +61,9 @@ render_user_icon (ActUser *user,
goto out;
}
- error = NULL;
- pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
- "avatar-default",
- icon_size * scale,
- GTK_ICON_LOOKUP_FORCE_SIZE,
- &error);
- if (error) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
-
+ source_pixbuf = generate_default_avatar (user, AVATAR_CHOOSER_PIXEL_SIZE);
+ if (source_pixbuf)
+ pixbuf = round_image (source_pixbuf);
out:
if (pixbuf != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]