[gnome-builder] scrolled-window: enforce 5x3 aesthetics



commit b4f1e4e6bca602e6a88c85c858a4965ce7c0a0cc
Author: Christian Hergert <chergert redhat com>
Date:   Sat Sep 17 17:49:54 2016 -0700

    scrolled-window: enforce 5x3 aesthetics
    
    This just tries to keep some sanity to how things look when we have large
    scrollable content. Not really useful for general purpose stuff, but is
    for our preferences in Builder.

 contrib/egg/egg-scrolled-window.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/contrib/egg/egg-scrolled-window.c b/contrib/egg/egg-scrolled-window.c
index b33c79e..03653bf 100644
--- a/contrib/egg/egg-scrolled-window.c
+++ b/contrib/egg/egg-scrolled-window.c
@@ -65,6 +65,17 @@ egg_scrolled_window_get_preferred_height_for_width (GtkWidget *widget,
   if (max_content_height > 0)
     *nat_height = MIN (*nat_height, max_content_height);
 
+  *nat_height = MAX (*min_height, *nat_height);
+
+  /*
+   * Special case for our use. What we should probably do is have a "grow with child
+   * range" but still fill into larger space with vexpand.
+   *
+   * This tries to enfoce at least a 5x3 ratio for the content, for asthetic reasons.
+   */
+  if (*nat_height > width && *min_height < (width / 5 * 3))
+    *min_height = (width / 5 * 3);
+
   *min_height += border_width * 2;
   *nat_height += border_width * 2;
 }


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