refactor: move dock context menu implementation to loader module#317
Merged
Conversation
1. Deleted old dock context menu files from plugins/dde-dock/common 2. Created new simplified DockContextMenu class in src/loader 3. Simplified menu implementation by removing width calculation and Wayland specific code 4. Changed PluginItem to use new DockContextMenu class 5. Moved reminder dot painting logic directly into paintEvent 6. Updated CMakeLists.txt to include new files The change was made to: 1. Reduce complexity by removing unused features 2. Move menu implementation closer to where it's actually used 3. Simplify maintenance by having a single implementation 4. Remove dependency on Wayland-specific code in common module refactor: 将停靠栏上下文菜单实现移至加载器模块 1. 从 plugins/dde-dock/common 删除旧的停靠栏上下文菜单文件 2. 在 src/loader 中创建新的简化版 DockContextMenu 类 3. 通过移除宽度计算和Wayland特定代码简化菜单实现 4. 修改 PluginItem 使用新的 DockContextMenu 类 5. 将提醒点绘制逻辑直接移到 paintEvent 中 6. 更新 CMakeLists.txt 包含新文件 这些修改的目的: 1. 通过移除未使用功能降低复杂性 2. 将菜单实现移到实际使用的位置 3. 通过单一实现简化维护 4. 移除公共模块中对Wayland特定代码的依赖 pms: TASK-377199
deepin pr auto review关键摘要:
是否建议立即修改: |
Reviewer's GuideThis PR refactors the dock context menu by removing the legacy common-module implementation, introducing a streamlined DockContextMenu in the loader, integrating it into PluginItem, and updating the build configuration accordingly. Sequence diagram for displaying context menu with reminder dotssequenceDiagram
participant User
participant PluginItem
participant DockContextMenu
User->>PluginItem: Right-clicks to open context menu
PluginItem->>DockContextMenu: new DockContextMenu()
PluginItem->>DockContextMenu: addAction(action)
Note right of PluginItem: Sets 'showReminder' property on action
PluginItem->>DockContextMenu: exec()
DockContextMenu->>DockContextMenu: paintEvent(e)
Note right of DockContextMenu: If action.property("showReminder") is true, draws reminder dot
DockContextMenu-->>User: Shows context menu with reminder dots
Class diagram for DockContextMenu and PluginItemclassDiagram
class QMenu {
<<Qt Class>>
}
class QWidget {
<<Qt Class>>
}
class PluginItem {
-DockContextMenu* m_menu
+PluginItem(PluginsItemInterface*, QString)
+initPluginMenu()
}
class DockContextMenu {
+DockContextMenu(QWidget* parent)
#paintEvent(QPaintEvent* e)
}
QMenu <|-- DockContextMenu
QWidget <|-- PluginItem
PluginItem o-- DockContextMenu : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
approved these changes
May 28, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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 |
There was a problem hiding this comment.
Hey @mhduiy - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: blocked) |
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.
The change was made to:
refactor: 将停靠栏上下文菜单实现移至加载器模块
这些修改的目的:
pms: TASK-377199
Summary by Sourcery
Move and streamline the dock context menu implementation into the loader module by deleting the old implementation and consolidating menu behavior into a single class.
Enhancements:
Chores: