aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/oofposabslikemgr.cc7
-rw-r--r--dw/oofposrelmgr.cc49
-rw-r--r--dw/oofposrelmgr.hh11
3 files changed, 49 insertions, 18 deletions
diff --git a/dw/oofposabslikemgr.cc b/dw/oofposabslikemgr.cc
index 5884957d..bde9d71b 100644
--- a/dw/oofposabslikemgr.cc
+++ b/dw/oofposabslikemgr.cc
@@ -72,7 +72,9 @@ void OOFPosAbsLikeMgr::sizeAllocateChildren ()
void OOFPosAbsLikeMgr::getSize (Requisition *containerReq, int *oofWidth,
int *oofHeight)
{
- DBG_OBJ_ENTER0 ("resize.oofm", 0, "getSize");
+ DBG_OBJ_ENTER ("resize.oofm", 0, "getSize", "%d * (%d + %d)",
+ containerReq->width, containerReq->ascent,
+ containerReq->descent);
*oofWidth = *oofHeight = 0;
@@ -97,8 +99,7 @@ void OOFPosAbsLikeMgr::getSize (Requisition *containerReq, int *oofWidth,
child->consideredForSize = false;
}
- DBG_OBJ_MSGF ("resize.oofm", 0, "=> %d * %d", *oofWidth, *oofHeight);
- DBG_OBJ_LEAVE ();
+ DBG_OBJ_LEAVE_VAL ("%d * %d", *oofWidth, *oofHeight);
}
void OOFPosAbsLikeMgr::getExtremes (Extremes *containerExtr, int *oofMinWidth,
diff --git a/dw/oofposrelmgr.cc b/dw/oofposrelmgr.cc
index 8fb34cd9..c19eb2e7 100644
--- a/dw/oofposrelmgr.cc
+++ b/dw/oofposrelmgr.cc
@@ -85,11 +85,9 @@ void OOFPosRelMgr::sizeAllocateChildren ()
Requisition childReq;
child->widget->sizeRequest (&childReq);
- Allocation *genAlloc = child->generator == container ?
- &containerAllocation : child->generator->getAllocation (),
- childAlloc;
- childAlloc.x = genAlloc->x + getChildPosX (child);
- childAlloc.y = genAlloc->y + getChildPosY (child);
+ Allocation childAlloc;
+ childAlloc.x = containerAllocation.x + getChildPosX (child);
+ childAlloc.y = containerAllocation.y + getChildPosY (child);
childAlloc.width = childReq.width;
childAlloc.ascent = childReq.ascent;
childAlloc.descent = childReq.descent;
@@ -102,6 +100,10 @@ void OOFPosRelMgr::sizeAllocateChildren ()
void OOFPosRelMgr::getSize (Requisition *containerReq, int *oofWidth,
int *oofHeight)
{
+ DBG_OBJ_ENTER ("resize.oofm", 0, "getSize", "%d * (%d + %d)",
+ containerReq->width, containerReq->ascent,
+ containerReq->descent);
+
*oofWidth = *oofHeight = 0;
for (int i = 0; i < children->size (); i++) {
@@ -114,13 +116,15 @@ void OOFPosRelMgr::getSize (Requisition *containerReq, int *oofWidth,
child->widget->sizeRequest (&childReq);
*oofWidth = max (*oofWidth, getChildPosX (child) + childReq.width);
*oofHeight = max (*oofHeight,
- getChildPosX (child) + childReq.ascent
+ getChildPosY (child) + childReq.ascent
+ childReq.descent);
child->consideredForSize = true;
} else
child->consideredForSize = false;
}
+
+ DBG_OBJ_LEAVE_VAL ("%d * %d", *oofWidth, *oofHeight);
}
void OOFPosRelMgr::getExtremes (Extremes *containerExtr, int *oofMinWidth,
@@ -163,6 +167,39 @@ bool OOFPosRelMgr::posYAbsolute (Child *child)
return false;
}
+int OOFPosRelMgr::getChildPosX (Child *child, int refWidth)
+{
+ DBG_OBJ_ENTER ("resize.oofm", 0, "getChildPosX", "[%p], %d",
+ child->widget, refWidth);
+
+ int gx = generatorPosX (child);
+ int dim = getChildPosDim (child->widget->getStyle()->left,
+ child->widget->getStyle()->right,
+ child->x,
+ refWidth
+ - child->widget->getStyle()->boxDiffWidth ());
+
+ DBG_OBJ_LEAVE_VAL ("%d + %d = %d", gx, dim, gx + dim);
+ return gx + dim;
+}
+
+
+int OOFPosRelMgr::getChildPosY (Child *child, int refHeight)
+{
+ DBG_OBJ_ENTER ("resize.oofm", 0, "getChildPosY", "[%p], %d",
+ child->widget, refHeight);
+
+ int gy = generatorPosY (child);
+ int dim = getChildPosDim (child->widget->getStyle()->top,
+ child->widget->getStyle()->bottom,
+ child->y,
+ refHeight
+ - child->widget->getStyle()->boxDiffHeight ());
+
+ DBG_OBJ_LEAVE_VAL ("%d + %d = %d", gy, dim, gy + dim);
+ return gy + dim;
+}
+
int OOFPosRelMgr::getChildPosDim (style::Length posCssValue,
style::Length negCssValue, int refPos,
int refLength)
diff --git a/dw/oofposrelmgr.hh b/dw/oofposrelmgr.hh
index 841ee45b..d61c15d9 100644
--- a/dw/oofposrelmgr.hh
+++ b/dw/oofposrelmgr.hh
@@ -14,21 +14,14 @@ protected:
bool posXAbsolute (Child *child);
bool posYAbsolute (Child *child);
+ int getChildPosX (Child *child, int refWidth);
+ int getChildPosY (Child *child, int refHeight);
int getChildPosDim (core::style::Length posCssValue,
core::style::Length negCssValue, int refPos,
int refLength);
- inline int getChildPosX (Child *child, int refWidth)
- { return getChildPosDim
- (child->widget->getStyle()->left, child->widget->getStyle()->right,
- child->x, refWidth - child->widget->getStyle()->boxDiffWidth ()); }
inline int getChildPosX (Child *child)
{ return getChildPosX (child, container->getAvailWidth (true)); }
-
- inline int getChildPosY (Child *child, int refHeight)
- { return getChildPosDim
- (child->widget->getStyle()->top, child->widget->getStyle()->bottom,
- child->y, refHeight - child->widget->getStyle()->boxDiffHeight ()); }
inline int getChildPosY (Child *child)
{ return getChildPosY (child, container->getAvailHeight (true)); }