fix(widget): keep popup inside schedule view bounds - #351
wangruoxuan3782 wants to merge 1 commit into
Conversation
1. Replace window width with CScheduleView width for popup right-bound check so the popup no longer overflows past the day view's right edge into the mini calendar. 2. Clamp the popup vertical position so the arrow stays centered and the popup never spills above or below the schedule view. 3. Apply the bounds fix to both day and week views since they share the same popup show path. Log: Clamp popup position to CScheduleView bounds so it is fully visible in day view. Influence: Popup no longer clipped by right-side mini calendar. fix(widget): 修复日视图浮窗被右侧内容遮挡 1. 浮窗右边界判断由窗口宽度改为 CScheduleView 自身宽度,避免浮窗超出日视图右边界被迷你日历遮挡。 2. 限制浮窗纵向位置,箭头保持垂直居中,防止浮窗上下溢出日程视图。 3. 日视图与周视图共用同一弹窗路径,一并修复。 Log: 将浮窗定位限制在日程视图范围内,解决日视图浮窗显示不全。 PMS: BUG-374977 Influence: 日视图浮窗不再被右侧迷你日历遮挡。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wangruoxuan3782 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 |
|
Hi @wangruoxuan3782. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates schedule popup positioning so day- and week-view popups remain fully visible within CScheduleView, avoiding obstruction by the mini calendar and preventing vertical overflow. Flow diagram for schedule popup boundary positioningflowchart TD
A[Schedule clicked] --> B[mapFromGlobal]
B --> C[Compute popup dimensions and arrow offset]
C --> D{Popup exceeds CScheduleView width?}
D -->|Yes| E[setDirection ArrowRight]
D -->|No| F[setDirection ArrowLeft]
E --> G[Clamp showY within CScheduleView height]
F --> G
G --> H[show popup within schedule view]
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 found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/calendar-client/src/customWidget/scheduleview.cpp" line_range="551-552" />
<code_context>
+ int showY = rPos.y();
+ if (showY - arrowY < 0)
+ showY = arrowY;
+ else if (showY - arrowY + popupH > this->height())
+ showY = this->height() - popupH + arrowY;
+
+ if ((rPos.x() + popupW + offsetPx) > this->width()) {
</code_context>
<issue_to_address>
**issue (bug_risk):** When the popup is too close to the bottom edge, `showY` is set to `height() - popupH + arrowY` and then passed directly to `show()`, so the popup's bottom edge becomes `height() + arrowY` and overflows the `CScheduleView` by the arrow offset.
**Triggers:** When the clicked schedule is near the bottom of the schedule view.
**Suggested fix:** Clamp the actual popup top-left position to `0..height() - popupH`, or subtract `arrowY` before passing the position to `show()` if the API expects the arrow anchor coordinate.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| else if (showY - arrowY + popupH > this->height()) | ||
| showY = this->height() - popupH + arrowY; |
There was a problem hiding this comment.
issue (bug_risk): When the popup is too close to the bottom edge, showY is set to height() - popupH + arrowY and then passed directly to show(), so the popup's bottom edge becomes height() + arrowY and overflows the CScheduleView by the arrow offset.
Triggers: When the clicked schedule is near the bottom of the schedule view.
Suggested fix: Clamp the actual popup top-left position to 0..height() - popupH, or subtract arrowY before passing the position to show() if the API expects the arrow anchor coordinate.
修复内容
日视图里点击日程弹出的浮窗有时显示不全,被右侧迷你日历遮挡。
原因
浮窗右边界判断用的是
this->window()->width()(整个窗口宽度),但rPos是相对于CScheduleView的坐标。日视图中CScheduleView只占窗口左侧约一半,右侧还有迷你日历,导致边界判断几乎永远不成立,浮窗总是往右弹,超出CScheduleView右边界被裁剪。改动
关联
PMS: https://pms.uniontech.com/bug-view-374977.html
Summary by Sourcery
Keep schedule reminder popups fully visible within day and week schedule views.
Bug Fixes: