More TODO resolution and TODOs.
This commit is contained in:
parent
e46822a9b1
commit
f130360be6
|
@ -77,6 +77,14 @@ void uiControlSetParent(uiControl *c, uiControl *parent)
|
||||||
controlUpdateState(c);
|
controlUpdateState(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only to be called by the immediate parent of a control
|
||||||
|
int controlSelfVisible(uiControl *c)
|
||||||
|
{
|
||||||
|
struct controlBase *cb = controlBase(c);
|
||||||
|
|
||||||
|
return !cb->hidden;
|
||||||
|
}
|
||||||
|
|
||||||
static int controlContainerVisible(uiControl *c)
|
static int controlContainerVisible(uiControl *c)
|
||||||
{
|
{
|
||||||
struct controlBase *cb = controlBase(c);
|
struct controlBase *cb = controlBase(c);
|
||||||
|
@ -143,6 +151,7 @@ void controlUpdateState(uiControl *c)
|
||||||
osCommitDisable(c);
|
osCommitDisable(c);
|
||||||
(*(c->ContainerUpdateState))(c);
|
(*(c->ContainerUpdateState))(c);
|
||||||
// and queue a resize, just in case we showed/hid something
|
// and queue a resize, just in case we showed/hid something
|
||||||
|
// for instance, on Windows uiBox, if we don't do this, hiding a control will show empty space until the window is resized
|
||||||
//TODO uiControlQueueResize(c);
|
//TODO uiControlQueueResize(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ extern void complain(const char *, ...);
|
||||||
|
|
||||||
extern int isToplevel(uiControl *);
|
extern int isToplevel(uiControl *);
|
||||||
extern uiControl *toplevelOwning(uiControl *);
|
extern uiControl *toplevelOwning(uiControl *);
|
||||||
|
extern int controlSelfVisible(uiControl *);
|
||||||
extern void controlUpdateState(uiControl *);
|
extern void controlUpdateState(uiControl *);
|
||||||
|
|
||||||
extern void osCommitEnable(uiControl *);
|
extern void osCommitEnable(uiControl *);
|
||||||
|
|
|
@ -79,8 +79,8 @@ static void minimumSize(uiWindowsControl *c, uiWindowsSizing *d, intmax_t *width
|
||||||
maxStretchyHeight = 0;
|
maxStretchyHeight = 0;
|
||||||
for (i = 0; i < b->controls->len; i++) {
|
for (i = 0; i < b->controls->len; i++) {
|
||||||
bc = ptrArrayIndex(b->controls, struct child *, i);
|
bc = ptrArrayIndex(b->controls, struct child *, i);
|
||||||
//TODO if (!uiControlContainerVisible(bc->c))
|
if (!childVisible(bc))
|
||||||
//TODO continue;
|
continue;
|
||||||
childMinimumSize(bc, dself, &minimumWidth, &minimumHeight);
|
childMinimumSize(bc, dself, &minimumWidth, &minimumHeight);
|
||||||
if (ctrlStretchy(bc)) {
|
if (ctrlStretchy(bc)) {
|
||||||
nStretchy++;
|
nStretchy++;
|
||||||
|
@ -151,8 +151,8 @@ static void boxRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t wi
|
||||||
nStretchy = 0;
|
nStretchy = 0;
|
||||||
for (i = 0; i < b->controls->len; i++) {
|
for (i = 0; i < b->controls->len; i++) {
|
||||||
bc = ptrArrayIndex(b->controls, struct child *, i);
|
bc = ptrArrayIndex(b->controls, struct child *, i);
|
||||||
//TODO if (!uiControlContainerVisible(bc->c))
|
if (!childVisible(bc))
|
||||||
//TODO continue;
|
continue;
|
||||||
if (ctrlStretchy(bc)) {
|
if (ctrlStretchy(bc)) {
|
||||||
nStretchy++;
|
nStretchy++;
|
||||||
continue;
|
continue;
|
||||||
|
@ -177,8 +177,8 @@ static void boxRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t wi
|
||||||
stretchywid /= nStretchy;
|
stretchywid /= nStretchy;
|
||||||
for (i = 0; i < b->controls->len; i++) {
|
for (i = 0; i < b->controls->len; i++) {
|
||||||
bc = ptrArrayIndex(b->controls, struct child *, i);
|
bc = ptrArrayIndex(b->controls, struct child *, i);
|
||||||
//TODO if (!uiControlContainerVisible(bc->c))
|
if (!childVisible(bc))
|
||||||
//TODO continue;
|
continue;
|
||||||
if (ctrlStretchy(bc)) {
|
if (ctrlStretchy(bc)) {
|
||||||
ctrlSetWidth(bc, stretchywid);
|
ctrlSetWidth(bc, stretchywid);
|
||||||
ctrlSetHeight(bc, stretchyht);
|
ctrlSetHeight(bc, stretchyht);
|
||||||
|
@ -191,8 +191,8 @@ static void boxRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t wi
|
||||||
y = 0;
|
y = 0;
|
||||||
for (i = 0; i < b->controls->len; i++) {
|
for (i = 0; i < b->controls->len; i++) {
|
||||||
bc = ptrArrayIndex(b->controls, struct child *, i);
|
bc = ptrArrayIndex(b->controls, struct child *, i);
|
||||||
//TODO if (!uiControlContainerVisible(bc->c))
|
if (!childVisible(bc))
|
||||||
//TODO continue;
|
continue;
|
||||||
childRelayout(bc, x, y, ctrlWidth(bc), ctrlHeight(bc));
|
childRelayout(bc, x, y, ctrlWidth(bc), ctrlHeight(bc));
|
||||||
if (b->vertical)
|
if (b->vertical)
|
||||||
y += ctrlHeight(bc) + ypadding;
|
y += ctrlHeight(bc) + ypadding;
|
||||||
|
|
|
@ -113,6 +113,11 @@ void childQueueRelayout(struct child *c)
|
||||||
uiWindowsControlQueueRelayout(uiWindowsControl(c->c));
|
uiWindowsControlQueueRelayout(uiWindowsControl(c->c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int childVisible(struct child *c)
|
||||||
|
{
|
||||||
|
return controlSelfVisible(c->c);
|
||||||
|
}
|
||||||
|
|
||||||
void childUpdateState(struct child *c)
|
void childUpdateState(struct child *c)
|
||||||
{
|
{
|
||||||
controlUpdateState(c->c);
|
controlUpdateState(c->c);
|
||||||
|
|
|
@ -104,6 +104,7 @@ extern HWND childHWND(struct child *c);
|
||||||
extern void childMinimumSize(struct child *c, uiWindowsSizing *d, intmax_t *width, intmax_t *height);
|
extern void childMinimumSize(struct child *c, uiWindowsSizing *d, intmax_t *width, intmax_t *height);
|
||||||
extern void childRelayout(struct child *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height);
|
extern void childRelayout(struct child *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height);
|
||||||
extern void childQueueRelayout(struct child *c);
|
extern void childQueueRelayout(struct child *c);
|
||||||
|
extern int childVisible(struct child *c);
|
||||||
extern void childUpdateState(struct child *c);
|
extern void childUpdateState(struct child *c);
|
||||||
extern HWND childTabPage(struct child *c);
|
extern HWND childTabPage(struct child *c);
|
||||||
extern int childMargined(struct child *c);
|
extern int childMargined(struct child *c);
|
||||||
|
|
Loading…
Reference in New Issue