[gtk+/gtk-3-10] Fix problems with dialog sizing



commit 2436627eb4644234a9e577538ec334d224e3d2be
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Dec 1 14:55:02 2013 -0500

    Fix problems with dialog sizing
    
    Many dialogs contain wrapping labels, but don't set
    max-width-chars on them. Previously, we were capping their
    width at 640, but since 3.10.5, they extend all the way to
    the width of the screen, which is not the desired behaviour.
    
    Go back to capping the width of dialogs at 640 in the stable
    series. In git master, we will set max-width-chars on the
    labels instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719516
    https://bugzilla.gnome.org/show_bug.cgi?id=719569

 gtk/gtkwindow.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index cf80839..6be50c8 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5708,7 +5708,10 @@ gtk_window_guess_default_size (GtkWindow *window,
                                        &workarea);
     }
 
-  *width = workarea.width;
+  /* We still cap the width at 640, to avoid dialogs with wrapping labels
+   * without max-width-chars from filling the entire width of the screen
+   */
+  *width = GTK_IS_DIALOG (window) ? 640 : workarea.width;
   *height = workarea.height;
 
   if (gtk_widget_get_request_mode (widget) == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT)


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