diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-11-24 20:29:29 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-01-21 14:51:30 +0100 |
commit | 586fac8e8daa7665302b075f900d8d2df90716f9 (patch) | |
tree | bfb02ad2e88d6e6b3e6bd013853a0792de951849 /plugingui/widget.cc | |
parent | 8976d1106ac40e74b7bdc4d0401003126cee53d8 (diff) |
Added TabWidget.
Diffstat (limited to 'plugingui/widget.cc')
-rw-r--r-- | plugingui/widget.cc | 20 |
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) || |