diff --git a/gb.qt4/src/CContainer.cpp b/gb.qt4/src/CContainer.cpp index ff4ce14b8..8b3b2700e 100755 --- a/gb.qt4/src/CContainer.cpp +++ b/gb.qt4/src/CContainer.cpp @@ -1197,6 +1197,9 @@ BEGIN_PROPERTY(UserControl_Container) GB.Error("Container must be a child control"); else { + GB_COLOR bg = CWIDGET_get_background((CWIDGET *)current, true); + GB_COLOR fg = CWIDGET_get_foreground((CWIDGET *)current, true); + if (current) CWIDGET_container_for(current, NULL); CWIDGET_container_for(cont, THIS); @@ -1206,6 +1209,8 @@ BEGIN_PROPERTY(UserControl_Container) CWIDGET_update_design((CWIDGET *)THIS); CCONTAINER_arrange(THIS); + CWIDGET_set_color((CWIDGET *)cont, bg, fg, true); + CWIDGET_register_proxy(THIS, cont); } } diff --git a/gb.qt4/src/CFont.cpp b/gb.qt4/src/CFont.cpp index 1f5d660a2..daa3dff9b 100644 --- a/gb.qt4/src/CFont.cpp +++ b/gb.qt4/src/CFont.cpp @@ -254,8 +254,8 @@ static void CFONT_manage(int prop, CFONT *_object, void *_param) int g = VPROP(GB_INTEGER); if (g < -4) g = -4; - else if (g > 16) - g = 16; + else if (g > 24) + g = 24; //f->setPointSizeFloat((int)(powf(qApp->font().pointSizeFloat(), 1.0 + ((int)g / 16.0)) + 0.5)); f->setPointSizeF(GRADE_TO_SIZE(g, qApp->font().pointSizeF())); } diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index d6ca90de5..ea2426aff 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -85,7 +85,7 @@ QSet *_enter_leave_set = NULL; #define EXT(_ob) (((CWIDGET *)_ob)->ext) #define ENSURE_EXT(_ob) (EXT(_ob) ? EXT(_ob) : alloc_ext((CWIDGET *)(_ob))) - + #define HANDLE_PROXY(_ob) \ while (EXT(_ob) && EXT(_ob)->proxy) \ _ob = (typeof _ob)(EXT(_ob)->proxy); @@ -1484,8 +1484,10 @@ void CWIDGET_reset_color(CWIDGET *_object) } -void CWIDGET_set_color(CWIDGET *_object, int bg, int fg) +void CWIDGET_set_color(CWIDGET *_object, int bg, int fg, bool handle_proxy) { + if (handle_proxy) { HANDLE_PROXY(_object); } + ENSURE_EXT(THIS); THIS_EXT->bg = bg; THIS_EXT->fg = fg; @@ -1494,8 +1496,10 @@ void CWIDGET_set_color(CWIDGET *_object, int bg, int fg) } -GB_COLOR CWIDGET_get_background(CWIDGET *_object) +GB_COLOR CWIDGET_get_background(CWIDGET *_object, bool handle_proxy) { + if (handle_proxy) { HANDLE_PROXY(_object); } + return THIS_EXT ? THIS_EXT->bg : COLOR_DEFAULT; } @@ -1516,8 +1520,10 @@ int CWIDGET_get_real_background(CWIDGET *_object) } -GB_COLOR CWIDGET_get_foreground(CWIDGET *_object) +GB_COLOR CWIDGET_get_foreground(CWIDGET *_object, bool handle_proxy) { + if (handle_proxy) { HANDLE_PROXY(_object); } + return THIS_EXT ? THIS_EXT->fg : COLOR_DEFAULT; } diff --git a/gb.qt4/src/CWidget.h b/gb.qt4/src/CWidget.h index ba89ad01c..f5fe0a83d 100644 --- a/gb.qt4/src/CWidget.h +++ b/gb.qt4/src/CWidget.h @@ -184,17 +184,15 @@ QString CWIDGET_Utf8ToQString(GB_STRING *str); void CWIDGET_destroy(CWIDGET *); void CWIDGET_update_design(CWIDGET *_object); void CWIDGET_iconset(QIcon &icon, const QPixmap &p, int size = 0); -void CWIDGET_set_color(CWIDGET *_object, int bg, int fg); +void CWIDGET_set_color(CWIDGET *_object, int bg, int fg, bool handle_proxy = false); void CWIDGET_reset_color(CWIDGET *_object); -GB_COLOR CWIDGET_get_background(CWIDGET *_object); -GB_COLOR CWIDGET_get_foreground(CWIDGET *_object); +GB_COLOR CWIDGET_get_background(CWIDGET *_object, bool handle_proxy = false); +GB_COLOR CWIDGET_get_foreground(CWIDGET *_object, bool handle_proxy = false); int CWIDGET_get_real_background(CWIDGET *_object); -//int CWIDGET_get_real_foreground(CWIDGET *_object, bool return_default); void *CWIDGET_get_parent(void *_object); int CWIDGET_get_handle(void *_object); bool CWIDGET_is_visible(void *_object); void CWIDGET_set_visible(CWIDGET *_object, bool v); -//void CWIDGET_check_hovered(); void CWIDGET_grab(CWIDGET *_object); void CWIDGET_move(void *_object, int x, int y); void CWIDGET_resize(void *_object, int w, int h);