GNOME Bugzilla – Bug 742395
Default user avatar icon looks fuzzy on HiDPI screen
Last modified: 2015-01-20 16:16:29 UTC
Created attachment 293840 [details] screenshot On a 13" inch laptop with 3200x1800 screen. The avatar icon looks fuzzy and pixelated.
Created attachment 294036 [details] [review] support hidpi for user's avatar Attached patch fixes it only for GtkImage. It is achieved using cairo surface and scale factor. Not sure if there isn't better way how to do that... However I'm quite afraid it isn't possible to fix it for tree view, is it?
Comment on attachment 294036 [details] [review] support hidpi for user's avatar Working on a fix for the Tree View also (alex gave me help)...
Created attachment 294419 [details] [review] support hidpi for user's avatar There is modified patch which adds hidpi support also for avatars in treeview and tracks scale-factor changes... It can be easily tested using GtkInspector -> Visual -> Window scaling.
Created attachment 294420 [details] screenshot with patch
Review of attachment 294419 [details] [review]: ::: panels/user-accounts/um-user-panel.c @@ +878,3 @@ +/* Update pixbufs according current scale factor */ +static void +scale_changed (GObject *object, This needs to be split up, and handled individually by each widget instead. @@ +931,1 @@ image = get_widget (d, "user-icon-image"); I would make user-icon-image and user-icon-image2 a GtkImage subclass, and handle the scale-factor change there. @@ +1645,2 @@ column = gtk_tree_view_column_new (); cell = gtk_cell_renderer_pixbuf_new (); Ditto, a cell renderer subclass would make it way nicer. ::: panels/user-accounts/um-utils.h @@ +76,3 @@ gchar * get_smart_date (GDateTime *date); +cairo_surface_t *render_user_icon (ActUser *user, You can land this as a separate commit, and change the callers to use "scale = 1" before making the other changes.
Created attachment 294526 [details] [review] user-accounts: render user's icons as surface with scale There is separate commit with scale = 1.
Created attachment 294527 [details] [review] user-accounts: hidpi support for user's icons GtkImage subclass to handle that...
Created attachment 294528 [details] [review] user-accounts: hidpi support for user's icons in tree view GtkCellRendererPixbuf subclass...
Review of attachment 294526 [details] [review]: Looks good otherwise. ::: panels/user-accounts/um-utils.c @@ +943,3 @@ /* Draw border */ + cairo_set_line_width (cr, 0.9 * scale); + cairo_arc (cr, width - 8.5 * scale, height - 8.5 * scale, 6 * scale, 0, 2 * G_PI); Did you mean: (width - 8.5) * scale or: width - 8.5 * scale ? Ditto with height.
Review of attachment 294527 [details] [review]: Looks good otherwise. ::: panels/user-accounts/um-user-image.c @@ +32,3 @@ +enum { + PROP_0, + PROP_USER As you don't use the property anyway, just remove all the property related code in here.
Review of attachment 294528 [details] [review]: Looks good.
Thanks for reviews, I will fix it and commit... (In reply to comment #9) > Review of attachment 294526 [details] [review]: > > Looks good otherwise. > > ::: panels/user-accounts/um-utils.c > @@ +943,3 @@ > /* Draw border */ > + cairo_set_line_width (cr, 0.9 * scale); > + cairo_arc (cr, width - 8.5 * scale, height - 8.5 * scale, 6 * scale, > 0, 2 * G_PI); > > Did you mean: > (width - 8.5) * scale > or: > width - 8.5 * scale > ? I mean "width - 8.5 * scale" without parenthesis, because width and height comes from the pixbuf (and the pixbuf is double sized for GDK_SCALE=2).
Comment on attachment 294526 [details] [review] user-accounts: render user's icons as surface with scale commit 006b5970a63c3e5df6769b61ffc3c75534e948e7
Comment on attachment 294527 [details] [review] user-accounts: hidpi support for user's icons commit 5c305302719a2e2cc58c09d499fe84efd942ad26
Comment on attachment 294528 [details] [review] user-accounts: hidpi support for user's icons in tree view commit 006b5970a63c3e5df6769b61ffc3c75534e948e7