[evolution/gnome-3-8] Make EAlertDialog non-resizable.



commit 4cdeae1de597d292264a15cf0afd05d34a514b9e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed May 29 18:54:55 2013 -0400

    Make EAlertDialog non-resizable.
    
    Making EAlertDialog non-resizable is the only way at present for GTK+ to
    pick a resonable default size, otherwise we get alerts looking like this:
    https://bugzilla.gnome.org/attachment.cgi?id=221303
    
    See https://bugzilla.gnome.org/681937 for details.
    
    Also drop the default window size hack in alert_dialog_constructed().
    
    (cherry picked from commit 5b2ee4af6fafecfff78f15662c94e62470a9a43d)

 e-util/e-alert-dialog.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index 8a75101..b4e12ad 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -125,8 +125,6 @@ alert_dialog_constructed (GObject *object)
        GList *actions;
        const gchar *primary, *secondary;
        gint default_response;
-       gint min_width = -1, prefer_width = -1;
-       gint height;
 
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (e_alert_dialog_parent_class)->constructed (object);
@@ -138,6 +136,11 @@ alert_dialog_constructed (GObject *object)
 
        gtk_window_set_title (GTK_WINDOW (dialog), " ");
 
+       /* XXX Making the window non-resizable is the only way at
+        *     present for GTK+ to pick a reasonable default size.
+        *     See https://bugzilla.gnome.org/681937 for details. */
+       gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+
        action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
        content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 
@@ -251,17 +254,6 @@ alert_dialog_constructed (GObject *object)
        gtk_widget_set_can_focus (widget, FALSE);
        gtk_widget_show (widget);
 
-       widget = GTK_WIDGET (dialog);
-
-       height = gtk_widget_get_allocated_height (widget);
-       gtk_widget_get_preferred_width_for_height (
-               widget, height, &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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]