[GB.QT4]
* BUG: * BUG: Correctly update background and foreground of multi-container controls. * BUG: Font.Grade maximum value is now +24, as expected by the font selector. git-svn-id: svn://localhost/gambas/trunk@6049 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
19bc16f26b
commit
9b0c084da1
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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()));
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ QSet<CWIDGET *> *_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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user