diff options
author | Ondrej Holy <oholy@redhat.com> | 2014-09-17 16:22:53 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2014-09-19 13:35:15 +0200 |
commit | d82a2101d5ac7bfa3f24b4502a8c5afe73c0e48c (patch) | |
tree | 9c5e56eecf581367f28fcd7c56f76812c1e40ae4 | |
parent | 63a9755cddad4d2a2ebe9e94f67b731776e31957 (diff) | |
download | gnome-control-center-d82a2101d5ac7bfa3f24b4502a8c5afe73c0e48c.tar.gz |
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
-rw-r--r-- | panels/region/cc-region-panel.c | 10 | ||||
-rw-r--r-- | 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 508120cb3..458fd9a77 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 2e3b51669..c9293af1a 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); |