diff options
author | Sebastian Geerken <devnull@localhost> | 2014-06-19 00:33:14 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-06-19 00:33:14 +0200 |
commit | 35f6933fe62d7f0c809b67eeba1a261a8b1fd782 (patch) | |
tree | 9e3955fc138f043eb8e635e370f981f5ee693546 | |
parent | 1dac15300d4046bca40c09281010935d9600e177 (diff) |
RTFL.
-rw-r--r-- | dw/table.cc | 8 | ||||
-rw-r--r-- | dw/widget.cc | 34 |
2 files changed, 37 insertions, 5 deletions
diff --git a/dw/table.cc b/dw/table.cc index 7546ffff..6118de75 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -553,20 +553,22 @@ void Table::forceCalcCellSizes (bool calcHeights) DBG_OBJ_MSG ("resize", 0, "<b>forceCalcCellSizes</b>"); DBG_OBJ_MSG_START (); - int totalWidth = 0, childHeight; + int childHeight; core::Extremes extremes; // Will also call calcColumnExtremes(), when needed. getExtremes (&extremes); - totalWidth = getAvailWidth (true); - DBG_OBJ_SET_NUM ("totalWidth", totalWidth); + int totalWidth = getAvailWidth (true); + DBG_OBJ_MSGF ("resize", 1, "(i) totalWidth = %d", totalWidth); if (totalWidth < extremes.minWidth) totalWidth = extremes.minWidth; totalWidth -= ((numCols + 1) * getStyle()->hBorderSpacing + getStyle()->boxDiffWidth ()); + DBG_OBJ_MSGF ("resize", 1, "(ii) totalWidth = %d", totalWidth); + colWidths->setSize (numCols, 0); cumHeight->setSize (numRows + 1, 0); rowSpanCells->setSize (0); diff --git a/dw/widget.cc b/dw/widget.cc index 15b9cf5f..6889b741 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -475,7 +475,8 @@ int Widget::getAvailWidth (bool forceValue) { // TODO Correct by extremes? - DBG_OBJ_MSG ("resize", 0, "<b>getAvailWidth</b> ()"); + DBG_OBJ_MSGF ("resize", 0, "<b>getAvailWidth</b> (%s)", + forceValue ? "true" : "false"); DBG_OBJ_MSG_START (); int width; @@ -512,7 +513,8 @@ int Widget::getAvailHeight (bool forceValue) { // TODO Correct by ... not extremes, but ...? (Height extremes?) - DBG_OBJ_MSG ("resize", 0, "<b>getAvailHeight</b> ()"); + DBG_OBJ_MSGF ("resize", 0, "<b>getAvailHeight</b> (%s)", + forceValue ? "true" : "false"); DBG_OBJ_MSG_START (); int height; @@ -813,6 +815,28 @@ void Widget::setStyle (style::Style *style) queueResize (0, true); else queueDraw (); + + // These should better be attributed to the style itself, and a + // script processing RTFL messages could transfer it to something + // equivalent: + + DBG_OBJ_SET_NUM ("style.margin.top", style->margin.top); + DBG_OBJ_SET_NUM ("style.margin.bottom", style->margin.bottom); + DBG_OBJ_SET_NUM ("style.margin.left", style->margin.left); + DBG_OBJ_SET_NUM ("style.margin.right", style->margin.right); + + DBG_OBJ_SET_NUM ("style.border-width.top", style->borderWidth.top); + DBG_OBJ_SET_NUM ("style.border-width.bottom", style->borderWidth.bottom); + DBG_OBJ_SET_NUM ("style.border-width.left", style->borderWidth.left); + DBG_OBJ_SET_NUM ("style.border-width.right", style->borderWidth.right); + + DBG_OBJ_SET_NUM ("style.padding.top", style->padding.top); + DBG_OBJ_SET_NUM ("style.padding.bottom", style->padding.bottom); + DBG_OBJ_SET_NUM ("style.padding.left", style->padding.left); + DBG_OBJ_SET_NUM ("style.padding.right", style->padding.right); + + DBG_OBJ_SET_NUM ("style.border-spacing (h)", style->hBorderSpacing); + DBG_OBJ_SET_NUM ("style.border-spacing (v)", style->vBorderSpacing); } /** @@ -1131,6 +1155,9 @@ int Widget::getAvailWidthOfChild (Widget *child, bool forceValue) width = -1; else { int containerContentWidth = availWidth - boxDiffWidth (); + DBG_OBJ_MSGF ("resize", 1, "containerContentWidth = %d - %d = %d", + availWidth, boxDiffWidth (), containerContentWidth); + if (style::isPerLength (child->getStyle()->width)) width = style::multiplyWithPerLength (containerContentWidth, child->getStyle()->width) @@ -1169,6 +1196,9 @@ int Widget::getAvailHeightOfChild (Widget *child, bool forceValue) height = -1; else { int containerContentHeight = availHeight - boxDiffHeight (); + DBG_OBJ_MSGF ("resize", 1, "containerContentHeight = %d - %d = %d", + availHeight, boxDiffHeight (), containerContentHeight); + if (style::isPerLength (child->getStyle()->height)) height = style::multiplyWithPerLength (containerContentHeight, child->getStyle()->height) |