summaryrefslogtreecommitdiff
path: root/plugingui/stackedwidget.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/stackedwidget.cc
parent8976d1106ac40e74b7bdc4d0401003126cee53d8 (diff)
Added TabWidget.
Diffstat (limited to 'plugingui/stackedwidget.cc')
-rw-r--r--plugingui/stackedwidget.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugingui/stackedwidget.cc b/plugingui/stackedwidget.cc
index 77f0f58..069e80b 100644
--- a/plugingui/stackedwidget.cc
+++ b/plugingui/stackedwidget.cc
@@ -32,6 +32,7 @@ namespace GUI
StackedWidget::StackedWidget(Widget *parent)
: Widget(parent)
{
+ CONNECT(this, sizeChangeNotifier, this, &StackedWidget::sizeChanged);
}
StackedWidget::~StackedWidget()
@@ -41,6 +42,7 @@ StackedWidget::~StackedWidget()
void StackedWidget::addWidget(Widget *widget)
{
widgets.push_back(widget);
+ widget->reparent(this);
if(currentWidget == nullptr)
{
@@ -91,4 +93,14 @@ void StackedWidget::setCurrentWidget(Widget *widget)
currentChanged(currentWidget);
}
+void StackedWidget::sizeChanged(int width, int height)
+{
+ // Propagate size change to child:
+ if(currentWidget)
+ {
+ currentWidget->move(0, 0);
+ currentWidget->resize(width, height);
+ }
+}
+
} // GUI::