From fbb4b6f53d2189ba9f61c1fd149534d8aef82dcd Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Sun, 25 Nov 2012 22:02:05 +0000
Subject: Ensured that automatic resizing fits well for small screen
 resolutions.

git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@292 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
---
 ChangeLog              |  5 +++++
 src/gui/panels/panel.c | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 719b2fe..d9e5efd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 12-11-25  Cyrille Bagard <nocbos@gmail.com>
 
+	* src/gui/panels/panel.c:
+	Ensure that automatic resizing fits well for small screen resolutions.
+
+12-11-25  Cyrille Bagard <nocbos@gmail.com>
+
 	* plugins/androhelpers/try_n_catch.c:
 	* src/analysis/disass/links.c:
 	* src/arch/dalvik/decomp/const.c:
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index 5718567..2749545 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -96,6 +96,9 @@ static void rebuild_panels_interface(const panel_node *);
 /* Part réservée aux parties principales (en %) */
 #define MAIN_PART_PERCENT 70
 
+/* Part minimale des petits composants (en %) */
+#define MIN_PART_PERCENT 20
+
 
 /* Met à jour l'affichage suite à un changement hiérarchique. */
 static void auto_resize_panels(GtkWidget *, GdkRectangle *, gpointer);
@@ -976,6 +979,22 @@ static void set_panel_node_size_request(const panel_node *node, const GtkRequisi
      * Calcul des valeurs applicables et mise en application.
      */
 
+    /* Correctifs éventuels pour les petits composants */
+    if (node->first == main_node)
+    {
+        if (GTK_IS_HPANED(node->paned))
+            second_req.width = MAX(second_req.width, (space->width * MIN_PART_PERCENT) / 100);
+        else
+            second_req.height = MAX(second_req.height, (space->height * MIN_PART_PERCENT) / 100);
+    }
+    else if (node->second == main_node)
+    {
+        if (GTK_IS_HPANED(node->paned))
+            first_req.width = MAX(first_req.width, (space->width * MIN_PART_PERCENT) / 100);
+        else
+            first_req.height = MAX(first_req.height, (space->height * MIN_PART_PERCENT) / 100);
+    }
+
     /* Une partie principale arrive en premier */
     if (!can_lower && can_upper)
     {
-- 
cgit v0.11.2-87-g4458