From cf1679faa699e0e991e9cac6173dba866f4bcfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 28 May 2022 23:41:23 +0200 Subject: [PATCH] Container are now still arranged when they are hidden because of a null size. [GB.GTK] * BUG: Container are now still arranged when they are hidden because of a null size. [GB.GTK3] * BUG: Container are now still arranged when they are hidden because of a null size. --- gb.gtk/src/gcontainer.cpp | 9 ++++++--- gb.qt4/share/gb.form.arrangement.h | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/gb.gtk/src/gcontainer.cpp b/gb.gtk/src/gcontainer.cpp index 71d1cfcce..d9756ebcf 100644 --- a/gb.gtk/src/gcontainer.cpp +++ b/gb.gtk/src/gcontainer.cpp @@ -65,11 +65,11 @@ static gboolean cb_expose(GtkWidget *wid, GdkEventExpose *e, gContainer *data) static void cb_map(GtkWidget *widget, gContainer *sender) { - //fprintf(stderr, "cb_map: %p / %p (%d) '%s'\n", sender, sender->hFree, gApplication::_disable_mapping_events, sender->name()); + if (gApplication::_disable_mapping_events) + return; sender->setShown(true); - if (!gApplication::_disable_mapping_events) - sender->arrangeLater(); + sender->arrangeLater(); } #if GTK3 @@ -98,6 +98,9 @@ static void cb_unmap(GtkWidget *widget, gContainer *sender) { //fprintf(stderr, "cb_unmap: %p / %p '%s'\n", sender, sender->hFree, sender->name()); + if (gApplication::_disable_mapping_events) + return; + sender->setShown(false); } diff --git a/gb.qt4/share/gb.form.arrangement.h b/gb.qt4/share/gb.form.arrangement.h index 880047f1f..b9168154e 100644 --- a/gb.qt4/share/gb.form.arrangement.h +++ b/gb.qt4/share/gb.form.arrangement.h @@ -678,12 +678,12 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont) case ARRANGE_VERTICAL: // #ifndef QNAMESPACE_H -// fprintf(stderr, "%s: VERTICAL: x = %d autoresize (%d, %d) pad %d spc %d [%d] rtl %d\n", +// fprintf(stderr, "%s: VERTICAL: x = %d autoresize (%d, %d) pad %d spc %d [%d] rtl %d\n", // ((gControl *)_object)->name(), x, x + arr->padding + wf, GET_WIDGET_H(cont), arr->padding, spacing, i, rtl); // #else -// fprintf(stderr, "%s: VERTICAL: y = %d autoresize (%d, %d) pad %d spc %d [%d] rtl %d hec %d\n", -// ((CWIDGET *)_object)->name, y, dmax + wf, has_expand_children ? GET_WIDGET_H(cont) : y + arr->padding + hf, -// arr->padding, spacing, i, rtl, has_expand_children); +// fprintf(stderr, "%s: VERTICAL: y = %d autoresize (%d, %d) pad %d spc %d [%d] rtl %d hec %d\n", +// ((CWIDGET *)_object)->name, y, dmax + wf, has_expand_children ? GET_WIDGET_H(cont) : y + arr->padding + hf, +// arr->padding, spacing, i, rtl, has_expand_children); // #endif //RESIZE_WIDGET(cont, GET_WIDGET_W(cont), y + arr->padding + hf); if (dmax > 0) @@ -698,9 +698,14 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont) break; case ARRANGE_ROW: - //if ((y + h + arr->padding + GET_WIDGET_H(cont) - hc - yc) < 16) - // qDebug("y = %d h = %d arr->padding = %d H = %d hc = %d yc = %d -> %d", y, h, arr->padding, GET_WIDGET_H(cont), hc, yc, (y + h + arr->padding + GET_WIDGET_H(cont) - hc - yc)); - RESIZE_CONTAINER(_object, cont, GET_WIDGET_W(cont), y + h + padding + hf); +// #ifndef GET_MAX_SIZE +// #ifndef QNAMESPACE_H +// fprintf(stderr, "%s: ROW: autoresize (%d, %d)\n", ((gControl *)_object)->name(), GET_WIDGET_W(cont), y + h + padding + hf); +// #else +// fprintf(stderr, "%s: ROW: autoresize (%d, %d)\n", ((CWIDGET *)_object)->name, GET_WIDGET_W(cont), y + h + padding + hf); +// #endif +// #endif +// RESIZE_CONTAINER(_object, cont, GET_WIDGET_W(cont), y + h + padding + hf); break; case ARRANGE_FILL: