diff --git a/loopstructural/gui/modelling/modelling_widget.py b/loopstructural/gui/modelling/modelling_widget.py index cae62c2..12df79f 100644 --- a/loopstructural/gui/modelling/modelling_widget.py +++ b/loopstructural/gui/modelling/modelling_widget.py @@ -19,7 +19,7 @@ StratigraphyStep, ViewStep, ) -from loopstructural.gui.modelling.steps.section_stack import SectionStack +from loopstructural.gui.modelling.steps.section_stack import SectionStack, page_scroll_area from loopstructural.gui.modelling.steps.step_bar import StepBar # How often the checks of the steps run again, in milliseconds. Several @@ -86,8 +86,10 @@ def __init__( self.header = DockHeader(self, data_manager=self.data_manager) self.step_bar = StepBar(STEPS, self) self.stack = QStackedWidget(self) + # A stacked widget is as tall as its tallest page. A scroll area around + # each page lets the dock be short: the page scrolls and the footer stays. for page in self.pages: - self.stack.addWidget(page) + self.stack.addWidget(page_scroll_area(page, self.stack)) self.footer_label = QLabel(self) # One line. The tooltip has all messages. The label can be shorter than diff --git a/loopstructural/gui/modelling/steps/pages.py b/loopstructural/gui/modelling/steps/pages.py index e23136f..2e0da99 100644 --- a/loopstructural/gui/modelling/steps/pages.py +++ b/loopstructural/gui/modelling/steps/pages.py @@ -32,7 +32,7 @@ from . import checks from .export_panel import ExportPanel -from .section_stack import SectionStack, page_scroll_area +from .section_stack import SectionStack class StepPage(QWidget): @@ -99,7 +99,7 @@ def __init__(self, parent=None, **kwargs): mode_row.addWidget(self.mode_combo, 1) layout.addLayout(mode_row) self.tab = ModelDefinitionTab(self, data_manager=self.data_manager) - layout.addWidget(page_scroll_area(self.tab, self), 1) + layout.addWidget(self.tab, 1) def set_workflow_mode(self, mode): index = self.mode_combo.findData(mode) @@ -138,7 +138,7 @@ def __init__(self, parent=None, **kwargs): ).setToolTip("Show the order of the column on the geology polygons.") # The source layers are a section of the column stack, so the page has - # at most two open sections and one scroll area. + # at most two open sections. The dock puts each page in a scroll area. self.stratigraphy_layers = StratigraphicLayersWidget(self, self.data_manager) sections = self.tab.stratigraphic_column_widget.sections sections.add_section( @@ -164,7 +164,7 @@ def __init__(self, parent=None, **kwargs): row.addStretch(1) row.addWidget(derive) layout.addLayout(row) - layout.addWidget(page_scroll_area(self.tab, self), 1) + layout.addWidget(self.tab, 1) # With contacts from the geology polygons, the "Stratigraphic layers" # section has the geology picker, so do not show a second one @@ -235,7 +235,7 @@ def __init__(self, parent=None, **kwargs): layout.addLayout(row) self.adjacency = FaultAdjacencyTab(self, data_manager=self.data_manager) - layout.addWidget(page_scroll_area(self.adjacency, self), 1) + layout.addWidget(self.adjacency, 1) def _fault_layer_summary(self): if self.data_manager is None: