aboutsummaryrefslogtreecommitdiff
path: root/dw/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/widget.cc')
-rw-r--r--dw/widget.cc17
1 files changed, 12 insertions, 5 deletions
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;