diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-16 02:19:41 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-02-16 02:19:41 +0800 |
commit | 23e3079db1c9343a89b2b80e1762e5c9597af8a5 (patch) | |
tree | 1d5c2976bec30229302459f3b2339da97aa24595 /e-util | |
parent | 0c896647968a54cb1e90cb6f2f97e1889b83dd11 (diff) | |
download | gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.tar gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.tar.gz gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.tar.bz2 gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.tar.lz gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.tar.xz gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.tar.zst gsoc2013-evolution-23e3079db1c9343a89b2b80e1762e5c9597af8a5.zip |
Slightly nicer EAlertDialog after move to gtk3
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-alert-dialog.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c index 1d1571cdb0..f714574b01 100644 --- a/e-util/e-alert-dialog.c +++ b/e-util/e-alert-dialog.c @@ -120,6 +120,10 @@ alert_dialog_constructed (GObject *object) PangoAttrList *list; GList *actions; const gchar *primary, *secondary; + gint min_width = -1, prefer_width = -1; + + /* Chain up to parent's constructed() method. */ + G_OBJECT_CLASS (e_alert_dialog_parent_class)->constructed (object); dialog = E_ALERT_DIALOG (object); alert = e_alert_dialog_get_alert (dialog); @@ -159,7 +163,7 @@ alert_dialog_constructed (GObject *object) gtk_box_pack_end ( GTK_BOX (action_area), - button, FALSE, TRUE, 0); + button, FALSE, FALSE, 0); actions = g_list_next (actions); } @@ -171,7 +175,7 @@ alert_dialog_constructed (GObject *object) widget = gtk_hbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (widget), 12); - gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), widget, FALSE, FALSE, 0); gtk_widget_show (widget); container = widget; @@ -213,10 +217,13 @@ alert_dialog_constructed (GObject *object) gtk_widget_set_can_focus (widget, FALSE); gtk_widget_show (widget); - pango_attr_list_unref (list); + widget = GTK_WIDGET (dialog); - /* Chain up to parent's constructed() method. */ - G_OBJECT_CLASS (e_alert_dialog_parent_class)->constructed (object); + gtk_widget_get_preferred_width_for_height (widget, gtk_widget_get_allocated_height (widget), &min_width, &prefer_width); + if (min_width < prefer_width) + gtk_window_set_default_size (GTK_WINDOW (dialog), MIN ((min_width + prefer_width) / 2, min_width * 5 / 4), -1); + + pango_attr_list_unref (list); } static void |