From aaf05b7c964ea8e13b7183b2319331599862d8c3 Mon Sep 17 00:00:00 2001 From: gambas Date: Sat, 8 May 2021 20:52:31 +0200 Subject: [PATCH] Automatic container resize now takes the arrangement of the parent of the container into account. [GB.GTK] * BUG: Automatic container resize now takes the arrangement of the parent of the container into account. [GB.GTK3] * BUG: Automatic container resize now takes the arrangement of the parent of the container into account. [GB.QT4] * BUG: Automatic container resize now takes the arrangement of the parent of the container into account. [GB.QT5] * BUG: Automatic container resize now takes the arrangement of the parent of the container into account. --- gb.gtk/src/gcontainer.cpp | 2 +- gb.gtk/src/gcontrol.cpp | 1 + gb.qt4/src/CContainer.cpp | 2 +- gb.qt4/src/CWidget.cpp | 1 + gb.qt4/src/CWindow.cpp | 3 +-- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gb.gtk/src/gcontainer.cpp b/gb.gtk/src/gcontainer.cpp index b22e89c59..5bee9cfd8 100644 --- a/gb.gtk/src/gcontainer.cpp +++ b/gb.gtk/src/gcontainer.cpp @@ -93,7 +93,7 @@ static void resize_container(gContainer *cont, int w, int h) h += cont->height() - cont->containerHeight();*/ if (w >= 0 && h >= 0) - cont->resize(w, h, true); + cont->resize(w, h); } diff --git a/gb.gtk/src/gcontrol.cpp b/gb.gtk/src/gcontrol.cpp index 7a6b1cd56..72e8f60c9 100644 --- a/gb.gtk/src/gcontrol.cpp +++ b/gb.gtk/src/gcontrol.cpp @@ -1353,6 +1353,7 @@ void gControl::setFocus() #if DEBUG_FOCUS fprintf(stderr, "setFocus now %s\n", name()); #endif + //win->activate(); gtk_widget_grab_focus(widget); } else diff --git a/gb.qt4/src/CContainer.cpp b/gb.qt4/src/CContainer.cpp index 14616c3da..40cf28a73 100755 --- a/gb.qt4/src/CContainer.cpp +++ b/gb.qt4/src/CContainer.cpp @@ -263,7 +263,7 @@ static void resize_container(void *_object, QWidget *cont, int w, int h) #if USE_CACHE resize_widget(_object, w + wid->width() - cont->width(), h + wid->height() - cont->height()); #else - CWIDGET_resize(_object, w + wid->width() - cont->width(), h + wid->height() - cont->height()); + CWIDGET_auto_resize(_object, w + wid->width() - cont->width(), h + wid->height() - cont->height()); #endif } diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index 3126dccee..7373854d6 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -1122,6 +1122,7 @@ static void set_focus(void *_object) { //qDebug("set focus on %s for %s", THIS->name, ((CWIDGET *)win)->name); WIDGET->setFocus(); + //((MyMainWindow *)(win->widget.widget))->activate(); } else if ((CWIDGET *)win != THIS) { diff --git a/gb.qt4/src/CWindow.cpp b/gb.qt4/src/CWindow.cpp index 22aec2f28..d819ede2e 100644 --- a/gb.qt4/src/CWindow.cpp +++ b/gb.qt4/src/CWindow.cpp @@ -879,7 +879,6 @@ BEGIN_PROPERTY(Window_Text) GB.Raise(THIS, EVENT_Title, 0); } - END_PROPERTY @@ -2373,7 +2372,7 @@ void MyMainWindow::resizeEvent(QResizeEvent *e) //qDebug("resizeEvent %ld %ld isHidden:%s shown:%s ", THIS->w, THIS->h, isHidden() ? "1" : "0", shown ? "1" : "0"); //qDebug("THIS->h = %ld THIS->container->height() = %ld height() = %ld", THIS->h, THIS->container->height(), height()); - if (THIS->opened) + if (THIS->opened && (e->spontaneous() || parentWidget())) raise_resize_event(THIS); }