fix: In the prompt interface, the grid is hidden to improve user expe…#459
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Mar 12, 2026
Merged
Conversation
…rience. In the prompt interface, the grid is hidden to improve user experience. 提示界面下,不显示井字格,提升用户体验。 Bug: https://pms.uniontech.com/bug-view-351495.html v20 BUG 分支合一到v25主线 Task: https://pms.uniontech.com/task-view-383481.html
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts grid overlay visibility logic in the video widget so that grid lines are hidden in prompt/notification UI states while remaining enabled in normal camera view, guarded by existing state flags. Sequence diagram for prompt UI grid hiding behaviorsequenceDiagram
actor User
participant UI as PromptUI
participant VW as videowidget
participant GridItem as m_pGridLineItem
participant GridWidget as m_gridlinewidget
User->>UI: Trigger no camera / camera used state
UI->>VW: showNocam() or showCamUsed()
VW->>VW: check m_GridType != Grid_None
alt Grid type active
VW->>GridItem: isVisible()
alt GridItem is visible
VW->>GridItem: hide()
end
VW->>GridWidget: isVisible()
alt GridWidget is visible
VW->>GridWidget: hide()
end
end
Sequence diagram for setGridType with prompt SVG visibility guardsequenceDiagram
participant Controller
participant VW as videowidget
participant GridItem as m_pGridLineItem
participant GridWidget as m_gridlinewidget
participant SvgItem as m_pSvgItem
Controller->>VW: setGridType(type)
VW->>VW: m_GridType = type
alt type == Grid_None
VW->>GridItem: hide()
VW->>GridWidget: hide()
else type != Grid_None
VW->>VW: decide grid representation
alt show overlay grid lines
VW->>GridWidget: hide()
VW->>SvgItem: isVisible()
alt SvgItem not visible
VW->>GridItem: show()
else SvgItem visible
VW->>GridItem: keep hidden
end
else other grid representation
VW->>GridItem: hide()
end
end
Class diagram for updated videowidget grid visibility logicclassDiagram
class videowidget {
<<QObject>>
GridType m_GridType
QGraphicsItem m_pGridLineItem
QWidget m_gridlinewidget
QGraphicsItem m_pSvgItem
void showNocam()
void showCamUsed()
void setGridType(GridType type)
}
class GridType {
}
videowidget --> GridType : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The grid-visibility logic for the prompt interface is duplicated in
showNocamandshowCamUsed; consider extracting a small helper (e.g.,updateGridForPromptState()) so the behavior is defined in one place. - The condition
if (!m_pSvgItem->isVisible())insetGridTypeis used as a proxy for whether the prompt interface is active; consider wrapping this in a clearly named helper (e.g.,isPromptInterfaceVisible()) to make the intent self-documenting and avoid relying on raw widget visibility checks. - The existing debug messages like
"Grid detected"and"Grid type is not Grid_None"now precede code that hides the grid; consider updating or adding logs so they clearly indicate that the grid is being hidden in the prompt interface.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The grid-visibility logic for the prompt interface is duplicated in `showNocam` and `showCamUsed`; consider extracting a small helper (e.g., `updateGridForPromptState()`) so the behavior is defined in one place.
- The condition `if (!m_pSvgItem->isVisible())` in `setGridType` is used as a proxy for whether the prompt interface is active; consider wrapping this in a clearly named helper (e.g., `isPromptInterfaceVisible()`) to make the intent self-documenting and avoid relying on raw widget visibility checks.
- The existing debug messages like `"Grid detected"` and `"Grid type is not Grid_None"` now precede code that hides the grid; consider updating or adding logs so they clearly indicate that the grid is being hidden in the prompt interface.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review针对您提供的 1. 语法逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
5. 改进建议总结
修改后的代码示例建议(针对 setGridType 部分): void videowidget::setGridType(GridType type)
{
// ... 其他代码 ...
if (type != Grid_None) {
if (m_gridlinewidget) {
m_gridlinewidget->hide();
}
// 增加空指针保护,并明确逻辑:仅当提示界面(Svg)不可见时,才显示网格
if (m_pSvgItem && !m_pSvgItem->isVisible()) {
if (m_pGridLineItem) {
m_pGridLineItem->show();
}
} else {
// 如果提示界面正在显示,确保网格是隐藏的
if (m_pGridLineItem) {
m_pGridLineItem->hide();
}
}
}
// ... 其他代码 ...
} |
lzwind
approved these changes
Mar 12, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lichaofan2008, lzwind 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 |
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.
…rience.
In the prompt interface, the grid is hidden to improve user experience.
提示界面下,不显示井字格,提升用户体验。
Bug: https://pms.uniontech.com/bug-view-351495.html
v20 BUG 分支合一到v25主线
Task: https://pms.uniontech.com/task-view-383481.html
Summary by Sourcery
Bug Fixes: