From 1b5f6d05080ee234ddd49dfc9b5a86d0c2909784 Mon Sep 17 00:00:00 2001 From: Grim Date: Tue, 24 Oct 2023 14:52:41 +0300 Subject: [PATCH] Fix #676 Window not redrawn on widget invalidation --- src/dlangui/widgets/widget.d | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dlangui/widgets/widget.d b/src/dlangui/widgets/widget.d index 9ff25378..a39e9201 100644 --- a/src/dlangui/widgets/widget.d +++ b/src/dlangui/widgets/widget.d @@ -1413,6 +1413,7 @@ public: /// request redraw void invalidate() { _needDraw = true; + window.update(); } /// helper function for implement measure() when widget's content dimensions are known @@ -1811,6 +1812,11 @@ class WidgetGroup : Widget { protected WidgetList _children; + override @property bool needDraw() + { + return _children.asArray.any!(x => x.needDraw) || _needDraw; + } + /// returns number of children of this widget @property override int childCount() const { return _children.count; } /// returns child by index