diff options
author | Sebastian Geerken <devnull@localhost> | 2016-01-01 14:54:31 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2016-01-01 14:54:31 +0100 |
commit | bf6aeb8e54aac0b5aec39de544ec41f3a59daddf (patch) | |
tree | c07ab632acc86a71bed08fe3d29b088a33277e2b /dw/widget.cc | |
parent | 21b11e2ef463d13f5ce1002a5ba2575c2cac3606 (diff) |
SRDOP: Consider references and positions in Widget::sizeRequest.
Diffstat (limited to 'dw/widget.cc')
-rw-r--r-- | dw/widget.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/dw/widget.cc b/dw/widget.cc index d63d1edc..a87072f0 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -68,6 +68,8 @@ Widget::Widget () DBG_OBJ_CREATE ("dw::core::Widget"); registerName ("dw::core::Widget", &CLASS_ID); + DBG_OBJ_ASSOC_CHILD (&requisitionParams); + flags = (Flags)(NEEDS_RESIZE | EXTREMES_CHANGED); parent = quasiParent = generator = container = NULL; DBG_OBJ_SET_PTR ("container", container); @@ -585,7 +587,24 @@ void Widget::sizeRequest (Requisition *requisition, int numPos, // Layout::resizeIdle. } - if (needsResize ()) { + bool callImpl; + if (needsResize ()) + callImpl = true; + else { + // Even if RESIZE_QUEUED / NEEDS_RESIZE is not set, calling + // sizeRequestImpl is necessary when the relavive positions passed here + // have changed. + SizeParams newParams (numPos, references, x, y); + DBG_OBJ_ASSOC_CHILD (&newParams); + if (newParams.isEquivalent (&requisitionParams)) + callImpl = false; + else { + callImpl = true; + requisitionParams = newParams; + } + } + + if (callImpl) { calcExtraSpace (true); /** \todo Check requisition == &(this->requisition) and do what? */ sizeRequestImpl (requisition, numPos, references, x, y); |