diff options
author | Sebastian Geerken <devnull@localhost> | 2014-07-24 23:40:21 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-07-24 23:40:21 +0200 |
commit | 6c77ae97e8d500a35caf3b9acdc5c0a377337d9d (patch) | |
tree | fd96fa08b1ef23266865edefed5587da3bdb6a39 /dw/widget.cc | |
parent | b6aeac03a3e6c5f4ea7edaad9a42b79cf5a8fe10 (diff) |
More work on tables; some reorganization.
Diffstat (limited to 'dw/widget.cc')
-rw-r--r-- | dw/widget.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/dw/widget.cc b/dw/widget.cc index 7192008a..5543ed38 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -1284,11 +1284,10 @@ int Widget::getAvailWidthOfChild (Widget *child, bool forceValue) if (child->getStyle()->width == style::LENGTH_AUTO) { DBG_OBJ_MSG ("resize", 1, "no specification"); - int availWidth = getAvailWidth (forceValue); - if (availWidth == -1) - width = -1; + if (forceValue) + width = misc::max (getAvailWidth (true) - boxDiffWidth (), 0); else - width = misc::max (availWidth - boxDiffWidth (), 0); + width = -1; } else { // In most cases, the toplevel widget should be a container, so // the container is non-NULL when the parent is non-NULL. Just @@ -1347,11 +1346,10 @@ int Widget::getAvailHeightOfChild (Widget *child, bool forceValue) if (child->getStyle()->height == style::LENGTH_AUTO) { DBG_OBJ_MSG ("resize", 1, "no specification"); - int availHeight = getAvailHeight (forceValue); - if (availHeight == -1) - height = -1; + if (forceValue) + height = misc::max (getAvailHeight (true) - boxDiffHeight (), 0); else - height = misc::max (availHeight - boxDiffHeight (), 0); + height = -1; } else { // In most cases, the toplevel widget should be a container, so // the container is non-NULL when the parent is non-NULL. Just |