summaryrefslogtreecommitdiff
path: root/plugingui/widget.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-11-24 20:29:29 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-01-21 14:51:30 +0100
commit586fac8e8daa7665302b075f900d8d2df90716f9 (patch)
treebfb02ad2e88d6e6b3e6bd013853a0792de951849 /plugingui/widget.cc
parent8976d1106ac40e74b7bdc4d0401003126cee53d8 (diff)
Added TabWidget.
Diffstat (limited to 'plugingui/widget.cc')
-rw-r--r--plugingui/widget.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugingui/widget.cc b/plugingui/widget.cc
index 3d9d47c..4b1d1f7 100644
--- a/plugingui/widget.cc
+++ b/plugingui/widget.cc
@@ -92,6 +92,26 @@ void Widget::removeChild(Widget* widget)
}
}
+void Widget::reparent(Widget* parent)
+{
+ if(parent == this->parent)
+ {
+ return; // Already at the right parent.
+ }
+
+ if(this->parent)
+ {
+ this->parent->removeChild(this);
+ }
+
+ if(parent)
+ {
+ parent->addChild(this);
+ }
+
+ this->parent = parent;
+}
+
void Widget::resize(int width, int height)
{
if((width < 1) || (height < 1) ||