summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r--src/gui/widgets/button.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 73a289630..842286ecb 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -915,3 +915,16 @@ void Button::setParent(Widget *widget)
mWindow->addWidgetListener(this);
Widget::setParent(widget);
}
+
+void Button::setWindow(Widget *const widget)
+{
+ if (!widget && mWindow)
+ {
+ mWindow->removeWidgetListener(this);
+ mWindow = nullptr;
+ }
+ else
+ {
+ Widget2::setWindow(widget);
+ }
+}