[gnome-control-center] user-accounts & region: allow multiline notifications



commit d82a2101d5ac7bfa3f24b4502a8c5afe73c0e48c
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Sep 17 16:22:53 2014 +0200

    user-accounts & region: allow multiline notifications
    
    The notification is wider then window for some languages (e.g.
    France). This patch allows wrapping, limits chars and changes
    margin as a result of discussion on #gnome-design.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703392

 panels/region/cc-region-panel.c      |   10 +++++++---
 panels/user-accounts/um-user-panel.c |   10 +++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 508120c..458fd9a 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -231,13 +231,17 @@ show_restart_notification (CcRegionPanel *self,
         priv->notification = gd_notification_new ();
         g_object_add_weak_pointer (G_OBJECT (priv->notification),
                                    (gpointer *)&priv->notification);
-        box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 24);
-        gtk_widget_set_margin_start (box, 12);
-        gtk_widget_set_margin_end (box, 12);
+        box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+        gtk_widget_set_margin_start (box, 6);
+        gtk_widget_set_margin_end (box, 6);
         gtk_widget_set_margin_top (box, 6);
         gtk_widget_set_margin_bottom (box, 6);
         label = gtk_label_new (_("Your session needs to be restarted for changes to take effect"));
+        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+        gtk_label_set_max_width_chars (GTK_LABEL (label), 30);
+        g_object_set (G_OBJECT (label), "xalign", 0, NULL);
         button = gtk_button_new_with_label (_("Restart Now"));
+        gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
         g_signal_connect_swapped (button, "clicked",
                                   G_CALLBACK (restart_now), self);
         gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 2e3b516..c9293af 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -884,13 +884,17 @@ show_restart_notification (CcUserPanelPrivate *d, gchar *locale)
 
         d->notification = gd_notification_new ();
         g_object_add_weak_pointer (G_OBJECT (d->notification), (gpointer *)&d->notification);
-        box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 24);
-        gtk_widget_set_margin_start (box, 12);
-        gtk_widget_set_margin_end (box, 12);
+        box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+        gtk_widget_set_margin_start (box, 6);
+        gtk_widget_set_margin_end (box, 6);
         gtk_widget_set_margin_top (box, 6);
         gtk_widget_set_margin_bottom (box, 6);
         label = gtk_label_new (_("Your session needs to be restarted for changes to take effect"));
+        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+        gtk_label_set_max_width_chars (GTK_LABEL (label), 30);
+        g_object_set (G_OBJECT (label), "xalign", 0, NULL);
         button = gtk_button_new_with_label (_("Restart Now"));
+        gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
         g_signal_connect_swapped (button, "clicked", G_CALLBACK (restart_now), d);
         gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
         gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);


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