Skip to content

Commit 6cbcbb4

Browse files
authored
fix: keep the dock short with a scroll area for each step (#142)
* fix: put each step page in a scroll area so the dock can be short A stacked widget is as tall as its tallest page. Steps 3, 4 and 5 had no scroll area, so the dock grew taller than the screen and the Back and Next buttons were out of reach. * fix: use one scroll area for each step page The dock puts each page in a scroll area. Remove the second scroll area that steps 1, 2 and 3 had inside the page.
1 parent 1d602dd commit 6cbcbb4

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

‎loopstructural/gui/modelling/modelling_widget.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
StratigraphyStep,
2020
ViewStep,
2121
)
22-
from loopstructural.gui.modelling.steps.section_stack import SectionStack
22+
from loopstructural.gui.modelling.steps.section_stack import SectionStack, page_scroll_area
2323
from loopstructural.gui.modelling.steps.step_bar import StepBar
2424

2525
# How often the checks of the steps run again, in milliseconds. Several
@@ -86,8 +86,10 @@ def __init__(
8686
self.header = DockHeader(self, data_manager=self.data_manager)
8787
self.step_bar = StepBar(STEPS, self)
8888
self.stack = QStackedWidget(self)
89+
# A stacked widget is as tall as its tallest page. A scroll area around
90+
# each page lets the dock be short: the page scrolls and the footer stays.
8991
for page in self.pages:
90-
self.stack.addWidget(page)
92+
self.stack.addWidget(page_scroll_area(page, self.stack))
9193

9294
self.footer_label = QLabel(self)
9395
# One line. The tooltip has all messages. The label can be shorter than

‎loopstructural/gui/modelling/steps/pages.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from . import checks
3434
from .export_panel import ExportPanel
35-
from .section_stack import SectionStack, page_scroll_area
35+
from .section_stack import SectionStack
3636

3737

3838
class StepPage(QWidget):
@@ -99,7 +99,7 @@ def __init__(self, parent=None, **kwargs):
9999
mode_row.addWidget(self.mode_combo, 1)
100100
layout.addLayout(mode_row)
101101
self.tab = ModelDefinitionTab(self, data_manager=self.data_manager)
102-
layout.addWidget(page_scroll_area(self.tab, self), 1)
102+
layout.addWidget(self.tab, 1)
103103

104104
def set_workflow_mode(self, mode):
105105
index = self.mode_combo.findData(mode)
@@ -138,7 +138,7 @@ def __init__(self, parent=None, **kwargs):
138138
).setToolTip("Show the order of the column on the geology polygons.")
139139

140140
# The source layers are a section of the column stack, so the page has
141-
# at most two open sections and one scroll area.
141+
# at most two open sections. The dock puts each page in a scroll area.
142142
self.stratigraphy_layers = StratigraphicLayersWidget(self, self.data_manager)
143143
sections = self.tab.stratigraphic_column_widget.sections
144144
sections.add_section(
@@ -164,7 +164,7 @@ def __init__(self, parent=None, **kwargs):
164164
row.addStretch(1)
165165
row.addWidget(derive)
166166
layout.addLayout(row)
167-
layout.addWidget(page_scroll_area(self.tab, self), 1)
167+
layout.addWidget(self.tab, 1)
168168

169169
# With contacts from the geology polygons, the "Stratigraphic layers"
170170
# section has the geology picker, so do not show a second one
@@ -235,7 +235,7 @@ def __init__(self, parent=None, **kwargs):
235235
layout.addLayout(row)
236236

237237
self.adjacency = FaultAdjacencyTab(self, data_manager=self.data_manager)
238-
layout.addWidget(page_scroll_area(self.adjacency, self), 1)
238+
layout.addWidget(self.adjacency, 1)
239239

240240
def _fault_layer_summary(self):
241241
if self.data_manager is None:

0 commit comments

Comments
 (0)