diff options
author | Sebastian Geerken <devnull@localhost> | 2014-05-29 14:19:29 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-05-29 14:19:29 +0200 |
commit | 8b7eb5032c7d40e6fe0fe21aff2523b7fa14e8f2 (patch) | |
tree | 80aff7801cdfecef30b0f2b9a7bdf61f1ccba2ae /dw | |
parent | 2f6d8aa3601505ad5490a212e75714abe3dcc77c (diff) |
Distinction between 'block-level' and 'possible container'.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/ruler.cc | 2 | ||||
-rw-r--r-- | dw/textblock_linebreaking.cc | 2 | ||||
-rw-r--r-- | dw/widget.cc | 17 | ||||
-rw-r--r-- | dw/widget.hh | 1 |
4 files changed, 15 insertions, 7 deletions
diff --git a/dw/ruler.cc b/dw/ruler.cc index cf4401ca..7969e3c0 100644 --- a/dw/ruler.cc +++ b/dw/ruler.cc @@ -49,7 +49,7 @@ void Ruler::setWidth (int width) } } - bool Ruler::isBlockLevel () +bool Ruler::isBlockLevel () { return true; } diff --git a/dw/textblock_linebreaking.cc b/dw/textblock_linebreaking.cc index a6fb75a4..6e9575e0 100644 --- a/dw/textblock_linebreaking.cc +++ b/dw/textblock_linebreaking.cc @@ -1645,7 +1645,7 @@ void Textblock::initLine1Offset (int wordIndex) int indent = 0; if (word->content.type == core::Content::WIDGET_IN_FLOW && - word->content.widget->isBlockLevel() == true) { + word->content.widget->isBlockLevel()) { /* don't use text-indent when nesting blocks */ } else { if (core::style::isPerLength(getStyle()->textIndent)) { diff --git a/dw/widget.cc b/dw/widget.cc index 891ec08b..cb283aca 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -159,11 +159,12 @@ void Widget::setParent (Widget *parent) container = NULL; for (Widget *widget = this; widget != NULL && container == NULL; widget = widget->getParent()) - if (widget->isBlockLevel ()) + if (widget->isPossibleContainer ()) container = widget; - // If there is no block-level widget, there is also no container - // (i. e. the viewport is used). Does not occur in dillo, where the - // toplevel widget is a Textblock. + // If there is no possible container widget, there is + // (surprisingly!) also no container (i. e. the viewport is + // used). Does not occur in dillo, where the toplevel widget is a + // Textblock. notifySetParent(); } @@ -831,7 +832,7 @@ void Widget::markExtremesChange (int ref) int Widget::getAvailWidthOfChild (Widget *child) { - // Must be implemented for block-level widgets. + // Must be implemented for possible containers. misc::assertNotReached (); return 0; } @@ -873,6 +874,12 @@ bool Widget::isBlockLevel () return false; } +bool Widget::isPossibleContainer () +{ + // In most (all?) cases identical to: + return isBlockLevel (); +} + bool Widget::buttonPressImpl (EventButton *event) { return false; diff --git a/dw/widget.hh b/dw/widget.hh index 9649ed2a..792b1082 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -414,6 +414,7 @@ public: virtual void setDescent (int descent); virtual bool isBlockLevel (); + virtual bool isPossibleContainer (); bool intersects (Rectangle *area, Rectangle *intersection); |