|
11 | 11 | QLabel, |
12 | 12 | QMessageBox, |
13 | 13 | QPushButton, |
14 | | - QScrollArea, |
15 | 14 | QSpinBox, |
16 | 15 | QVBoxLayout, |
17 | 16 | QWidget, |
|
23 | 22 |
|
24 | 23 | from ....background_task import finish_background_task, start_background_task |
25 | 24 | from ....messages import push_info, push_warning |
| 25 | +from ...steps.section_stack import SectionStack |
26 | 26 | from ..bounding_box_widget import BoundingBoxWidget |
27 | 27 | from ..layer_selection_table import LayerSelectionTable |
28 | 28 |
|
@@ -85,24 +85,13 @@ def __init__(self, parent=None, *, feature=None, model_manager=None, data_manage |
85 | 85 | self.feature = feature |
86 | 86 | self.model_manager = model_manager |
87 | 87 | self.data_manager = data_manager |
88 | | - # Create a scroll area for horizontal scrolling |
89 | | - scroll = QScrollArea(self) |
90 | | - scroll.setWidgetResizable(True) |
91 | | - scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded) |
92 | | - scroll.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded) |
93 | | - |
94 | | - # Create content widget to hold the form layout |
95 | | - content = QWidget() |
96 | | - self.layout = QVBoxLayout(content) |
97 | | - # Set the content widget as the scroll area's widget |
98 | | - scroll.setWidget(content) |
99 | | - |
100 | | - # Add scroll area to main layout |
| 88 | + # The sections of the panel. At most two are open. The page that holds |
| 89 | + # the panel has the scroll area. |
101 | 90 | mainLayout = QVBoxLayout(self) |
102 | | - mainLayout.addWidget(scroll) |
103 | | - |
104 | | - # Set the main layout |
105 | | - self.setLayout(mainLayout) |
| 91 | + mainLayout.setContentsMargins(0, 0, 0, 0) |
| 92 | + self.layout = SectionStack(self, 'feature_details', data_manager) |
| 93 | + mainLayout.addWidget(self.layout) |
| 94 | + mainLayout.addStretch(1) |
106 | 95 |
|
107 | 96 | ## define interpolator parameters |
108 | 97 | # Regularisation spin box |
@@ -176,9 +165,17 @@ def __init__(self, parent=None, *, feature=None, model_manager=None, data_manage |
176 | 165 | form_layout.addRow('Orientation point weight', self.npw_spin_box) |
177 | 166 | group_box = QgsCollapsibleGroupBox('Interpolator Settings') |
178 | 167 | group_box.setLayout(form_layout) |
179 | | - self.layout.addWidget(group_box) |
180 | | - self.layout.addWidget(self._build_preview_widget()) |
181 | | - self.layout.addWidget(table_group_box) |
| 168 | + self.layout.add_section( |
| 169 | + group_box, |
| 170 | + 'interpolator', |
| 171 | + 'Interpolator Settings', |
| 172 | + summary=lambda: ( |
| 173 | + f"{self.interpolator_type_combo.currentText()}, " |
| 174 | + f"{int(self.n_elements_spinbox.value())} elements" |
| 175 | + ), |
| 176 | + ) |
| 177 | + self.layout.add_section(self._build_preview_widget(), 'preview', 'Preview', collapsed=True) |
| 178 | + self.layout.add_section(table_group_box, 'data_layers', 'Data Layers') |
182 | 179 | # this will call the addMidBlock and addExportBlock methods |
183 | 180 | self.addMidBlock() |
184 | 181 | self.addExportBlock() |
|
0 commit comments