Repository navigation
fix: prevent settings panel and preview area from overlapping on small screens - #50
Merged
deepin-bot[bot] merged 1 commit intoOct 13, 2026
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR prevents settings/preview overlap by constraining the settings pane, relaxing the preview pane's minimum dimensions, and preventing the main window from shrinking below a layout-compatible 800×500 size; review primarily the resulting behavior at the minimum window size and on small screens. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: re2zero The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
re2zero
force-pushed
the
agent/pms-bug-bot/cc1edef1993e
branch
2 times, most recently
from
October 13, 2026 09:04
768360a to
1df3580
Compare
…small screens The window had no width minimum, so on a screen whose half width is below the 779px the two panels needed together it came up narrow enough for them to be laid out on top of each other (91px of overlap at 1366x768, 134px at 1280x720). The window minimum is now 800x571, the preview area minimum drops to 300x200, and the settings area is given the 276px its group box and margins need. 窗口缺少宽度下限,在半屏宽度小于两面板合计所需的 779px 的屏幕上会被创建得过窄,导致设置面板 压在预览区上(1366x768 重叠 91px,1280x720 重叠 134px)。现设置窗口最小尺寸 800x571,预览区 最小尺寸降为 300x200,设置区按组框加边距所需的 276px 设置最小宽度,设置项不再溢出设置区。 Log: 修复小屏幕上扫描设置面板与预览区重叠的问题 PMS: BUG-318759 Influence: 1366x768、1280x720 等小屏幕下设置面板与预览区不再重叠,设置项与按钮完整显示;窗口最小尺寸为 800x571。
re2zero
force-pushed
the
agent/pms-bug-bot/cc1edef1993e
branch
from
October 13, 2026 09:13
1df3580 to
a2033ab
Compare
lzwind
approved these changes
Oct 13, 2026
Contributor
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause Analysis
The scanner manager's settings panel and preview area overlap on small screens because
settingsArea(the right-side container inQHBoxLayout) has no minimum width constraint — the layout shrinks it below the 260px needed by its innersettingsGroup, causing overflow into the preview area. The preview area's 480×360 minimum is also too large for small windows, andMainWindowhas no minimum size to prevent shrinking past the point where both panels can coexist.Key evidence:
scanwidget.cpp:73(settingsAreacreated withoutsetMinimumWidth),scanwidget.cpp:62(previewArea->setMinimumSize(480, 360)),mainwindow.cpp:44(onlyresize, nosetMinimumSize).Fix
Set a 260px minimum width on
settingsAreaso it can't be compressed below its content's needs. Reduce the preview area minimum from 480×360 to 300×200 so both panels fit in smaller windows. Add an 800×500 minimum window size onMainWindowas a top-level guard against over-shrinking.Change Safety Assessment
Code Safety
Business Impact Scope
The changes affect the scanner manager's main window sizing and the scan settings page layout. On small-screen laptops (e.g., 1366×768), the window will no longer shrink to a size where the settings panel and preview area overlap. Normal-screen behavior is unaffected since the new minimums (800×500) are below typical default sizes.
Verification Suggestion
Test on a small-screen laptop: launch the scanner manager, click scan, and verify the settings panel and preview area do not overlap. Resize the window to its minimum and confirm the layout remains usable. Verify no regression on normal screens.
根因分析
扫描管理器在小屏幕上设置面板与预览区域重叠,根因是
settingsArea(QHBoxLayout右侧容器)未设置最小宽度约束——布局将其压缩到内部settingsGroup所需的 260px 以下,内容溢出到预览区域。同时previewArea的 480×360 最小尺寸对小窗口而言过大,MainWindow也未设置窗口最小尺寸兜底。关键证据:
scanwidget.cpp:73(settingsArea创建时无setMinimumWidth)、scanwidget.cpp:62(previewArea->setMinimumSize(480, 360))、mainwindow.cpp:44(仅resize无setMinimumSize)。修复方案
为
settingsArea设置 260px 最小宽度,防止被压缩到内容所需尺寸以下。将预览区域最小尺寸从 480×360 降至 300×200,使两个区域在小窗口下能共存。为MainWindow设置 800×500 最小窗口尺寸,从窗口级别兜底防止过度缩小。改动安全评估
代码安全评估
业务影响范围
改动影响扫描管理器主窗口尺寸和扫描设置页面布局。在小屏幕笔记本(如 1366×768)上,窗口不再缩小到设置面板与预览区域重叠的尺寸。正常屏幕行为不受影响,因为新的最小尺寸(800×500)低于典型默认尺寸。
验证建议
在小屏幕笔记本上测试:启动扫描管理器,点击扫描,验证设置面板与预览区域不重叠。将窗口缩到最小,确认布局仍然可用。验证正常屏幕下无回归。
Summary by Sourcery
Prevent scanner UI panels from overlapping by enforcing compatible minimum sizes for the main window and its preview and settings areas.
Bug Fixes:
Enhancements: