aboutsummaryrefslogtreecommitdiff
path: root/dw/layout.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/layout.cc')
-rw-r--r--dw/layout.cc30
1 files changed, 6 insertions, 24 deletions
diff --git a/dw/layout.cc b/dw/layout.cc
index 818effd2..bd519042 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -926,8 +926,7 @@ void Layout::resizeIdle ()
canvasHeightGreater = true;
DBG_OBJ_SET_SYM ("canvasHeightGreater",
canvasHeightGreater ? "true" : "false");
- assert (topLevel); // No toplevel widget would have no size.
- containerSizeChanged (topLevel);
+ containerSizeChanged ();
}
// Set viewport sizes.
@@ -1296,31 +1295,14 @@ void Layout::viewportSizeChanged (View *view, int width, int height)
DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
- if (topLevel)
- containerSizeChanged (topLevel);
+ containerSizeChanged ();
}
-bool Layout::widgetAffectedByContainerSizeChange (Widget *widget)
+void Layout::containerSizeChanged ()
{
- return true; // TODO only absolute dimensions? Depending on widget class?
-}
-
-void Layout::containerSizeChanged (Widget *widget)
-{
- if (widgetAffectedByContainerSizeChange (widget)) {
- widget->queueResize (0, false);
-
- // TODO Wrong! Iteration must stop when the *container* (not the
- // *parent*!) is unaffected. (Does not matter as long as
- // widgetAffectedByContainerSizeChange() returns always true.)
-
- Iterator *it =
- widget->iterator ((Content::Type)
- (Content::WIDGET_IN_FLOW | Content::WIDGET_OOF_CONT),
- false);
- while (it->next ())
- containerSizeChanged (it->getContent()->widget);
- it->unref ();
+ if (topLevel) {
+ topLevel->containerSizeChanged ();
+ queueResize (true);
}
}