diff options
author | Sebastian Geerken <devnull@localhost> | 2014-09-17 20:36:45 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-09-17 20:36:45 +0200 |
commit | e74a39fffeeba0e42dfc781eceb152a028c95a24 (patch) | |
tree | eabaa8f2af06b60ede7b7410f1d4360198d41c25 /dw/textblock.cc | |
parent | 88cabc495ed24d8c6304852e141fc5294699c0a2 (diff) |
Fixed available width for children of list items.
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r-- | dw/textblock.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index dd9260d6..a72b2ad1 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -734,7 +734,20 @@ int Textblock::getAvailWidthOfChild (Widget *child, bool forceValue) DBG_OBJ_ENTER ("resize", 0, "Textblock/getAvailWidthOfChild", "%p, %s", child, forceValue ? "true" : "false"); - int width = Widget::getAvailWidthOfChild (child, forceValue); + int width; + + if (child->getStyle()->width == core::style::LENGTH_AUTO) { + // No width specified: similar to standard implementation (see + // there), but "leftInnerPadding" has to be considered, too. + DBG_OBJ_MSG ("resize", 1, "no specification"); + if (forceValue) + width = misc::max (getAvailWidth (true) - boxDiffWidth () + - leftInnerPadding, + 0); + else + width = -1; + } else + width = Widget::getAvailWidthOfChild (child, forceValue); if (forceValue && this == child->getContainer () && !mustBeWidenedToAvailWidth ()) { |