summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-11-25 22:02:05 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-11-25 22:02:05 (GMT)
commitfbb4b6f53d2189ba9f61c1fd149534d8aef82dcd (patch)
tree7aead94cb8500f54b7c39861f3e9dcbee2e1dd94 /src/gui/panels
parent671cacb80fd438a5f4d51db853ed08d7a6edb9ab (diff)
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
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/panel.c19
1 files changed, 19 insertions, 0 deletions
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)
{