aboutsummaryrefslogtreecommitdiff
path: root/confui/ui_scroll_container.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'confui/ui_scroll_container.cpp')
-rw-r--r--confui/ui_scroll_container.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/confui/ui_scroll_container.cpp b/confui/ui_scroll_container.cpp
new file mode 100644
index 0000000..5a412f8
--- /dev/null
+++ b/confui/ui_scroll_container.cpp
@@ -0,0 +1,29 @@
+#include "ui_scroll_container.h"
+
+CDScrollContainerLayout::~CDScrollContainerLayout() { }
+CDScrollContainerLayout::CDScrollContainerLayout(QWidget *parent) : QVBoxLayout(parent) {
+ scroll_area = new QScrollArea;
+ scroll_container = new QWidget;
+ scroll_inner = new QVBoxLayout;
+
+ scroll_area->setWidgetResizable(true);
+ scroll_area->setFrameShape(QFrame::NoFrame);
+ scroll_area->setBackgroundRole(QPalette::Window);
+ scroll_area->setFrameShadow(QFrame::Plain);
+ scroll_area->setWidget(scroll_container);
+ scroll_area->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
+
+ scroll_container->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
+ scroll_container->setLayout(scroll_inner);
+
+ QVBoxLayout::addWidget(scroll_area);
+}
+
+void CDScrollContainerLayout::addWidget(QWidget* widget) {
+ scroll_inner->addWidget(widget);
+}
+
+void CDScrollContainerLayout::removeWidget(QWidget* widget) {
+ scroll_inner->removeWidget(widget);
+}
+