diff --git a/apps/autocal/src/orisys_autocal/ui/capture_settings_dialog.py b/apps/autocal/src/orisys_autocal/ui/capture_settings_dialog.py index 3be7f66..fa97f3b 100644 --- a/apps/autocal/src/orisys_autocal/ui/capture_settings_dialog.py +++ b/apps/autocal/src/orisys_autocal/ui/capture_settings_dialog.py @@ -65,6 +65,10 @@ DEFAULT_MBIT_PER_S = 10.0 #: itself. It only shapes the size estimate, never a recorded window. STEP_OVERHEAD_S = 5.0 +#: Qt's "no limit" for a widget's height, and the tallest preview this dialog shows. +_UNBOUNDED = 16777215 +_PREVIEW_MAX_HEIGHT = 200 + #: One probe per process. The probe writes three real clips, and every window in #: this app would otherwise repeat it; the answer cannot change while the process #: runs because it is a property of this machine's OpenCV build. @@ -130,11 +134,14 @@ class CaptureSettingsDialog(QDialog): self.input_group = QGroupBox(page) self.input_group.setObjectName("groupBox") input_layout = QVBoxLayout(self.input_group) - # The input panel is the live image plus its controls. It stays bounded - # here: the dialog has four sections, and a preview that expands would push - # the bundle, session and recording settings below the fold on every screen. - source_panel.setMaximumHeight(320) + # The input panel is the live image plus its controls. The preview is what + # is bounded here: the dialog has four sections, and a preview that expands + # would push the bundle, session and recording settings below the fold. The + # panel itself is never capped. Its field rows, buttons and hints need + # their natural height, and a cap below that squeezes them into each other. + source_panel.setMaximumHeight(_UNBOUNDED) source_panel.preview.setMinimumSize(140, 90) + source_panel.preview.setMaximumHeight(_PREVIEW_MAX_HEIGHT) input_layout.addWidget(source_panel) self.input_group.setSizePolicy( QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum diff --git a/apps/autocal/tests/test_capture_page.py b/apps/autocal/tests/test_capture_page.py index d1ffb69..98d4f75 100644 --- a/apps/autocal/tests/test_capture_page.py +++ b/apps/autocal/tests/test_capture_page.py @@ -734,3 +734,24 @@ def test_a_stored_unavailable_codec_does_not_become_the_selection(make_window): assert settings.codec.currentData() == "mp4v" assert settings.recording_options().codec == "mp4v" window.close() + + +def test_the_settings_dialog_does_not_squeeze_the_input_rows(make_window, qt_app): + """The input panel keeps its natural height: no row may overlap the next one.""" + window = make_window() + page = window.calibration_panel + dialog = page.settings + dialog.resize(720, 700) + dialog.show() + for _ in range(5): + qt_app.processEvents() + panel = window.finger_source_panel + + assert panel.height() >= panel.minimumSizeHint().height() + video = panel.video_path.geometry() + config = panel.config_ref.geometry() + assert video.bottom() < config.top(), (video, config) + # The preview stays bounded, so the sections below remain reachable. + assert panel.preview.height() <= 200 + dialog.close() + window.close()