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
This commit is contained in:
Ondrej Holy 2014-09-17 16:22:53 +02:00
parent 63a9755cdd
commit d82a2101d5
2 changed files with 14 additions and 6 deletions

View file

@ -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);

View file

@ -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);