Commit d82a2101 authored by Ondrej Holy's avatar Ondrej Holy
Browse files

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
parent 63a9755c
...@@ -231,13 +231,17 @@ show_restart_notification (CcRegionPanel *self, ...@@ -231,13 +231,17 @@ show_restart_notification (CcRegionPanel *self,
priv->notification = gd_notification_new (); priv->notification = gd_notification_new ();
g_object_add_weak_pointer (G_OBJECT (priv->notification), g_object_add_weak_pointer (G_OBJECT (priv->notification),
(gpointer *)&priv->notification); (gpointer *)&priv->notification);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 24); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_margin_start (box, 12); gtk_widget_set_margin_start (box, 6);
gtk_widget_set_margin_end (box, 12); gtk_widget_set_margin_end (box, 6);
gtk_widget_set_margin_top (box, 6); gtk_widget_set_margin_top (box, 6);
gtk_widget_set_margin_bottom (box, 6); gtk_widget_set_margin_bottom (box, 6);
label = gtk_label_new (_("Your session needs to be restarted for changes to take effect")); 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")); button = gtk_button_new_with_label (_("Restart Now"));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
g_signal_connect_swapped (button, "clicked", g_signal_connect_swapped (button, "clicked",
G_CALLBACK (restart_now), self); G_CALLBACK (restart_now), self);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
......
...@@ -884,13 +884,17 @@ show_restart_notification (CcUserPanelPrivate *d, gchar *locale) ...@@ -884,13 +884,17 @@ show_restart_notification (CcUserPanelPrivate *d, gchar *locale)
d->notification = gd_notification_new (); d->notification = gd_notification_new ();
g_object_add_weak_pointer (G_OBJECT (d->notification), (gpointer *)&d->notification); g_object_add_weak_pointer (G_OBJECT (d->notification), (gpointer *)&d->notification);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 24); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_margin_start (box, 12); gtk_widget_set_margin_start (box, 6);
gtk_widget_set_margin_end (box, 12); gtk_widget_set_margin_end (box, 6);
gtk_widget_set_margin_top (box, 6); gtk_widget_set_margin_top (box, 6);
gtk_widget_set_margin_bottom (box, 6); gtk_widget_set_margin_bottom (box, 6);
label = gtk_label_new (_("Your session needs to be restarted for changes to take effect")); 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")); 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); 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), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment