diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-16 02:19:41 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:35 +0800 |
commit | 3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c (patch) | |
tree | a2fabb017338eb8046fca39f847be8d0b8fd549d | |
parent | 0d27f00de3d811c8bea261a39dd5f9cf3b1b3895 (diff) | |
download | gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.tar gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.tar.gz gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.tar.bz2 gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.tar.lz gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.tar.xz gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.tar.zst gsoc2013-evolution-3c6cc7e1a7b2cf2af50c4d7372ae95d4f2ca690c.zip |
Slightly nicer EAlertDialog after move to gtk3
-rw-r--r-- | e-util/e-alert-dialog.c | 17 | ||||
-rw-r--r-- | mail/em-utils.c | 3 |
2 files changed, 13 insertions, 7 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 diff --git a/mail/em-utils.c b/mail/em-utils.c index ad75c4829f..cea8871887 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -151,9 +151,8 @@ em_utils_prompt_user (GtkWindow *parent, if (promptkey) { check = gtk_check_button_new_with_mnemonic (_("_Do not show this message again")); - gtk_container_set_border_width ((GtkContainer *)check, 12); container = gtk_dialog_get_content_area (GTK_DIALOG (mbox)); - gtk_box_pack_start (GTK_BOX (container), check, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0); gtk_widget_show (check); } |