[gnome-system-tools] Improve appearance of user profile dialog



commit bdb5596640eea5ff815aa3822f58c0e99b36b613
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Thu Dec 16 13:41:49 2010 +0100

    Improve appearance of user profile dialog
    
    With the move to GTK+3, we can justify labels. But the new packing
    behavior requires us to set a minimum width to the labels prevent the
    dialog from getting too narrow.

 interfaces/users.ui |    1 +
 src/users/table.c   |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/interfaces/users.ui b/interfaces/users.ui
index b07de79..33f14e1 100644
--- a/interfaces/users.ui
+++ b/interfaces/users.ui
@@ -2316,6 +2316,7 @@
                 <property name="label" translatable="yes">This account is using special settings that have been defined manually. Use the &lt;i&gt;Advanced Settings&lt;/i&gt; dialog to tune them.</property>
                 <property name="use_markup">True</property>
                 <property name="wrap">True</property>
+                <property name="justify">GTK_JUSTIFY_FILL</property>
                 <attributes>
                   <attribute name="size" value="9500"/>
                 </attributes>
diff --git a/src/users/table.c b/src/users/table.c
index 45bd41e..00ac0df 100644
--- a/src/users/table.c
+++ b/src/users/table.c
@@ -178,10 +178,14 @@ table_populate_profiles (GstUsersTool *tool,
 		                                                     profile->name);
 		label = gtk_label_new (profile->description);
 		gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+		gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL);
 		gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 		gtk_misc_set_padding (GTK_MISC (label), 16, 0);
 		gtk_label_set_attributes (GTK_LABEL (label), attributes);
 
+		/* To force a minimum size for the dialog, set a somewhat arbitrary length */
+		gtk_label_set_width_chars (GTK_LABEL (label), 50);
+
 		gtk_table_attach_defaults (GTK_TABLE (table),
 		                           radio, 0, ncols,
 		                           nrows + i, nrows + i + 1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]