diff options
author | Sebastian Geerken <devnull@localhost> | 2016-06-18 14:29:21 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2016-06-18 14:29:21 +0200 |
commit | 0f477f0eb575b5d060e8c2e2dbcbcded5703ad94 (patch) | |
tree | 34ff43a68b28b59a71548314c9effdc686c783a1 /dw/textblock.cc | |
parent | f26132d1a2e3850e155706b02b4df5d7c5251f68 (diff) |
Fix <button> size (treat as inline).
Diffstat (limited to 'dw/textblock.cc')
-rw-r--r-- | dw/textblock.cc | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index 52eda3e1..700c748b 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -202,7 +202,7 @@ void Textblock::setStretchabilityFactor (int stretchabilityFactor) Textblock::stretchabilityFactor = stretchabilityFactor; } -Textblock::Textblock (bool limitTextWidth) +Textblock::Textblock (bool limitTextWidth, bool treatAsInline) { DBG_OBJ_CREATE ("dw::Textblock"); registerName ("dw::Textblock", &CLASS_ID); @@ -252,6 +252,7 @@ Textblock::Textblock (bool limitTextWidth) DBG_OBJ_SET_NUM ("lineBreakWidth", lineBreakWidth); this->limitTextWidth = limitTextWidth; + this->treatAsInline = treatAsInline; for (int layer = 0; layer < core::HIGHLIGHT_NUM_LAYERS; layer++) { /* hlStart[layer].index > hlEnd[layer].index means no highlighting */ @@ -3169,18 +3170,28 @@ int Textblock::getMaxGeneratorWidth () bool Textblock::usesMaxGeneratorWidth () { DBG_OBJ_ENTER0 ("resize", 0, "usesMaxGeneratorWidth"); - bool toplevel = getParent () == NULL, - block = getStyle()->display == core::style::DISPLAY_BLOCK, - vloat = testWidgetFloat (this), - abspos = testWidgetAbsolutelyPositioned (this), - fixpos = testWidgetFixedlyPositioned (this), - // In detail, this depends on what the respective OOFM does - // with the child widget: + + bool result; + if (treatAsInline) { + DBG_OBJ_MSG ("resize", 1, "treatAsInline set"); + result = false; + } else { + bool toplevel = getParent () == NULL, + block = getStyle()->display == core::style::DISPLAY_BLOCK, + vloat = testWidgetFloat (this), + abspos = testWidgetAbsolutelyPositioned (this), + fixpos = testWidgetFixedlyPositioned (this); + DBG_OBJ_MSGF("resize", 1, + "toplevel: %s, block: %s, float: %s, abspos: %s, fixpos: %s", + boolToStr(toplevel), boolToStr(block), boolToStr(vloat), + boolToStr(abspos), boolToStr(fixpos)); + + // In detail, this depends on what the respective OOFM does with the + // child widget: result = toplevel || (block && !(vloat || abspos || fixpos)); - DBG_OBJ_LEAVE_VAL ("%s (toplevel: %s, block: %s, float: %s, abspos: %s, " - "fixpos: %s)", - boolToStr(result), boolToStr(toplevel), boolToStr(block), - boolToStr(vloat), boolToStr(abspos), boolToStr(fixpos)); + } + + DBG_OBJ_LEAVE_VAL ("%s", boolToStr(result)); return result; } |