From bc5dfc035d05abfc7f0e75ee76f81b740db47f45 Mon Sep 17 00:00:00 2001 From: ykcheungab Date: Mon, 19 Oct 2026 09:42:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=87=87=E9=9B=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=AF=B9=E8=AF=9D=E6=A1=86=E8=BE=93=E5=85=A5=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E8=A2=AB=E5=8E=8B=E7=BC=A9=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对话框把输入面板最大高度限制为 320,低于各行所需的自然高度,Finger 视频与传感器配置两行重叠。改为只限制预览图高度,并新增布局测试;已在 Windows 上目视确认。 --- .../ui/capture_settings_dialog.py | 15 +++++++++---- apps/autocal/tests/test_capture_page.py | 21 +++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) 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()