-
Notifications
You must be signed in to change notification settings - Fork 28
fix: correct popup position calculation in widget plugin #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1. Modified position calculation for plugin popups to use EmbedPlugin's position 2. Added null check for transient parent window 3. Uses pluginPos() from EmbedPlugin instead of direct window coordinates 4. Ensures popups appear in correct relative position to their parent plugin The previous implementation directly used the transient parent window's coordinates which could lead to incorrect positioning when the plugin was embedded in a complex layout. The new approach gets the accurate position from the EmbedPlugin itself. fix: 修正小部件插件中弹出窗口位置计算 1. 修改插件弹出窗口的位置计算以使用 EmbedPlugin 的位置 2. 为 transient 父窗口添加空值检查 3. 使用 EmbedPlugin 的 pluginPos() 而非直接窗口坐标 4. 确保弹出窗口相对于父插件显示在正确位置 之前的实现直接使用 transient 父窗口的坐标,当插件嵌入复杂布局时可能导致 位置计算错误。新方法从 EmbedPlugin 自身获取准确位置。 Pms: BUG-321795
Reviewer's GuideReplaces direct transientParent coordinate usage with EmbedPlugin's position API and adds null checks to ensure popups align correctly with the embedded plugin. Sequence diagram for popup position calculation in widget pluginsequenceDiagram
participant EventFilter
participant toolTipWindow
participant PluginPopup
participant parentWindow
participant EmbedPlugin
EventFilter->>toolTipWindow: Get transientParent()
toolTipWindow->>parentWindow: transientParent()
alt parentWindow is not null
EventFilter->>EmbedPlugin: getWithoutCreating(parentWindow)
alt EmbedPlugin exists
EmbedPlugin->>EmbedPlugin: pluginPos()
EmbedPlugin-->>EventFilter: pluginPos
EventFilter->>PluginPopup: setX(pluginPos.x + pos.x)
EventFilter->>PluginPopup: setY(pluginPos.y + pos.y)
end
end
Class diagram for updated popup position logicclassDiagram
class EventFilter {
+QObject
...
}
class PluginPopup {
+setX(int)
+setY(int)
+getWithoutCreating(QWidget*)
}
class EmbedPlugin {
+pluginPos() : QPoint
+getWithoutCreating(QWidget*)
}
class QWidget {
+transientParent() : QWidget*
+x() : int
+y() : int
}
EventFilter --> PluginPopup : uses
EventFilter --> EmbedPlugin : uses
PluginPopup ..> QWidget : window
EmbedPlugin ..> QWidget : parentWindow
QWidget <|-- toolTipWindow
QWidget <|-- parentWindow
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review关键摘要:
是否建议立即修改:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, wjyrich 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 |
|
/forcemerge |
1 similar comment
|
/forcemerge |
The previous implementation directly used the transient parent window's coordinates which could lead to incorrect positioning when the plugin was embedded in a complex layout. The new approach gets the accurate position from the EmbedPlugin itself.
fix: 修正小部件插件中弹出窗口位置计算
之前的实现直接使用 transient 父窗口的坐标,当插件嵌入复杂布局时可能导致
位置计算错误。新方法从 EmbedPlugin 自身获取准确位置。
Pms: BUG-321795
Summary by Sourcery
Fix widget plugin popup positioning by using EmbedPlugin’s accurate coordinates and adding a transient parent null check
Bug Fixes: