33 #include <QStackedWidget> |
33 #include <QStackedWidget> |
34 |
34 |
35 /* -------------------- UiBoxContainer -------------------- */ |
35 /* -------------------- UiBoxContainer -------------------- */ |
36 |
36 |
37 UiBoxContainer::UiBoxContainer(QBoxLayout* box) { |
37 UiBoxContainer::UiBoxContainer(QBoxLayout* box) { |
|
38 this->current = NULL; |
|
39 this->menu = NULL; |
38 this->box = box; |
40 this->box = box; |
39 box->setContentsMargins(QMargins(0,0,0,0)); |
41 box->setContentsMargins(QMargins(0,0,0,0)); |
40 box->setSpacing(0); |
42 box->setSpacing(0); |
41 |
43 |
42 ui_reset_layout(layout); |
44 ui_reset_layout(layout); |
63 |
65 |
64 if(fill) { |
66 if(fill) { |
65 hasStretchedWidget = true; |
67 hasStretchedWidget = true; |
66 } |
68 } |
67 ui_reset_layout(layout); |
69 ui_reset_layout(layout); |
|
70 current = widget; |
68 } |
71 } |
69 |
72 |
70 UIWIDGET ui_box(UiObject *obj, QBoxLayout::Direction dir) { |
73 UIWIDGET ui_box(UiObject *obj, QBoxLayout::Direction dir) { |
71 UiContainer *ct = uic_get_current_container(obj); |
74 UiContainer *ct = uic_get_current_container(obj); |
72 QWidget *widget = new QWidget(); |
75 QWidget *widget = new QWidget(); |
92 |
95 |
93 |
96 |
94 /* -------------------- UiGridContainer -------------------- */ |
97 /* -------------------- UiGridContainer -------------------- */ |
95 |
98 |
96 UiGridContainer::UiGridContainer(QGridLayout* grid) { |
99 UiGridContainer::UiGridContainer(QGridLayout* grid) { |
|
100 this->current = NULL; |
|
101 this->menu = NULL; |
97 this->grid = grid; |
102 this->grid = grid; |
98 grid->setContentsMargins(QMargins(0,0,0,0)); |
103 grid->setContentsMargins(QMargins(0,0,0,0)); |
99 grid->setSpacing(0); |
104 grid->setSpacing(0); |
100 ui_reset_layout(layout); |
105 ui_reset_layout(layout); |
101 } |
106 } |
118 |
123 |
119 grid->addWidget(widget, y, x); |
124 grid->addWidget(widget, y, x); |
120 x++; |
125 x++; |
121 |
126 |
122 ui_reset_layout(layout); |
127 ui_reset_layout(layout); |
|
128 current = widget; |
123 } |
129 } |
124 |
130 |
125 |
131 |
126 /* -------------------- UiTabViewContainer -------------------- */ |
132 /* -------------------- UiTabViewContainer -------------------- */ |
127 |
133 |
128 UiTabViewContainer::UiTabViewContainer(QTabWidget* tabwidget) { |
134 UiTabViewContainer::UiTabViewContainer(QTabWidget* tabwidget) { |
|
135 this->current = NULL; |
|
136 this->menu = NULL; |
129 this->tabwidget = tabwidget; |
137 this->tabwidget = tabwidget; |
130 } |
138 } |
131 |
139 |
132 void UiTabViewContainer::add(QWidget* widget, bool fill) { |
140 void UiTabViewContainer::add(QWidget* widget, bool fill) { |
133 QString str = QString::fromUtf8(layout.label); |
141 QString str = QString::fromUtf8(layout.label); |