diff options
author | Sebastian Geerken <devnull@localhost> | 2013-08-18 19:19:59 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-08-18 19:19:59 +0200 |
commit | fa0492628ec32770769c0b2dd06b66cfaaadd4c2 (patch) | |
tree | 12d22548c039ffd98b0468b814c2557407aa79dc | |
parent | e6a0209f67f4a2de964caaec5554a85ecc09e0ed (diff) |
Distinction between NEEDS_ALLOCATE and ALLOCATE_QUEUED.
-rw-r--r-- | dw/layout.cc | 3 | ||||
-rw-r--r-- | dw/widget.cc | 6 | ||||
-rw-r--r-- | dw/widget.hh | 20 |
3 files changed, 19 insertions, 10 deletions
diff --git a/dw/layout.cc b/dw/layout.cc index 5285dfea..9693bdbb 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -674,6 +674,9 @@ void Layout::resizeIdle () widget->setFlags (Widget::NEEDS_RESIZE); widget->unsetFlags (Widget::RESIZE_QUEUED); + widget->setFlags (Widget::NEEDS_ALLOCATE); + widget->unsetFlags (Widget::ALLOCATE_QUEUED); + if (widget->extremesQueued ()) { widget->setFlags (Widget::EXTREMES_CHANGED); widget->unsetFlags (Widget::EXTREMES_QUEUED); diff --git a/dw/widget.cc b/dw/widget.cc index e6c2cae0..d8d6a1d4 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -149,7 +149,7 @@ void Widget::queueResize (int ref, bool extremesChanged) } setFlags (resizeFlag); - setFlags (NEEDS_ALLOCATE); + setFlags (ALLOCATE_QUEUED); markSizeChange (ref); if (extremesChanged) { @@ -159,7 +159,7 @@ void Widget::queueResize (int ref, bool extremesChanged) for (widget2 = parent, child = this; widget2; child = widget2, widget2 = widget2->parent) { - //printf (" Setting %s and NEEDS_ALLOCATE for the " + //printf (" Setting %s and ALLOCATE_QUEUED for the " // "%stop-level %s %p with parentRef = %d\n", // resizeFlag == RESIZE_QUEUED ? "RESIZE_QUEUED" : "NEEDS_RESIZE", // widget2->parent ? "non-" : "", widget2->getClassName(), widget2, @@ -170,7 +170,7 @@ void Widget::queueResize (int ref, bool extremesChanged) widget2->setFlags (resizeFlag); widget2->markSizeChange (child->parentRef); - widget2->setFlags (NEEDS_ALLOCATE); + widget2->setFlags (ALLOCATE_QUEUED); if (extremesChanged) { widget2->setFlags (extremesFlag); diff --git a/dw/widget.hh b/dw/widget.hh index ab464c26..088c39a6 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -50,18 +50,23 @@ protected: * In some cases, the size of a widget remains the same, but the * children are allocated at different positions and in * different sizes, so that a simple comparison of old and new - * allocation is insufficient. Therefore, this flag is set in - * queueResize. + * allocation is insufficient. Therefore, this flag is set + * (indirectly, as ALLOCATE_QUEUED) in queueResize. */ NEEDS_ALLOCATE = 1 << 3, /** + * \todo Comment this. + */ + ALLOCATE_QUEUED = 1 << 4, + + /** * \brief Set, when dw::core::Widget::extremes is not up to date * anymore. * * \todo Update, see RESIZE_QUEUED. */ - EXTREMES_CHANGED = 1 << 4, + EXTREMES_CHANGED = 1 << 5, /** * \brief Set by the widget itself (in the constructor), when set... @@ -69,7 +74,7 @@ protected: * * Will hopefully be removed, after redesigning the size model. */ - USES_HINTS = 1 << 5, + USES_HINTS = 1 << 6, /** * \brief Set by the widget itself (in the constructor), when it contains @@ -77,19 +82,19 @@ protected: * * Will hopefully be removed, after redesigning the size model. */ - HAS_CONTENTS = 1 << 6, + HAS_CONTENTS = 1 << 7, /** * \brief Set, when a widget was already once allocated, * * The dw::Image widget uses this flag, see dw::Image::setBuffer. */ - WAS_ALLOCATED = 1 << 7, + WAS_ALLOCATED = 1 << 8, /** * \brief Set for block-level widgets (as opposed to inline widgets) */ - BLOCK_LEVEL = 1 << 8, + BLOCK_LEVEL = 1 << 9, }; private: @@ -266,6 +271,7 @@ public: inline bool extremesQueued () { return flags & EXTREMES_QUEUED; } inline bool needsResize () { return flags & NEEDS_RESIZE; } inline bool needsAllocate () { return flags & NEEDS_ALLOCATE; } + inline bool allocateQueued () { return flags & ALLOCATE_QUEUED; } inline bool extremesChanged () { return flags & EXTREMES_CHANGED; } inline bool wasAllocated () { return flags & WAS_ALLOCATED; } inline bool usesHints () { return flags & USES_HINTS; } |