From d2529a1a098e4211d9f19af64abdd33bc28642c9 Mon Sep 17 00:00:00 2001 From: Felipe Borges Date: Sun, 18 Dec 2016 14:39:04 +0100 Subject: [PATCH] user-accounts: Add "Your account" label below proper UmCarouselItem Set a margin for the username label instead of using the container spacing property. In doing so the labels are not so far apart from each other, but still distant from the profile icon/image. https://bugzilla.gnome.org/show_bug.cgi?id=767065 --- panels/user-accounts/um-user-panel.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c index c53d2d981..f1bba7292 100644 --- a/panels/user-accounts/um-user-panel.c +++ b/panels/user-accounts/um-user-panel.c @@ -176,7 +176,7 @@ create_carousel_entry (CcUserPanelPrivate *d, ActUser *user) GtkWidget *box, *widget; gchar *label; - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); widget = um_user_image_new (); um_user_image_set_user (UM_USER_IMAGE (widget), user); @@ -186,9 +186,23 @@ create_carousel_entry (CcUserPanelPrivate *d, ActUser *user) get_real_or_user_name (user)); widget = gtk_label_new (label); gtk_label_set_use_markup (GTK_LABEL (widget), TRUE); + gtk_widget_set_margin_top (widget, 5); gtk_box_pack_start (GTK_BOX (box), widget, FALSE, TRUE, 0); g_free (label); + if (act_user_get_uid (user) == getuid ()) + label = g_strdup (_("Your account")); + else + label = g_strdup (" "); + + widget = gtk_label_new (label); + gtk_label_set_use_markup (GTK_LABEL (widget), TRUE); + g_free (label); + + gtk_box_pack_start (GTK_BOX (box), widget, FALSE, TRUE, 0); + gtk_style_context_add_class (gtk_widget_get_style_context (widget), + "dim-label"); + return box; }