feat: add windowTitle property for popup windows#1512
feat: add windowTitle property for popup windows#151218202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
Added windowTitle property to PanelMenu, PanelPopup, and PanelToolTip QML components to distinguish different popup windows for window managers like KWin. The title property was moved from PanelPopupWindow.qml to individual component definitions to allow customization per popup type. This enables better window management and identification in compositors. Log: Added window title support for panel popup windows to improve window manager compatibility Influence: 1. Test that panel menus, popups, and tooltips display correctly with their respective window titles 2. Verify window manager can properly identify and manage different popup types 3. Check that popup positioning and functionality remain unchanged 4. Test with different window managers to ensure compatibility 5. Verify that the default window titles are correctly set for each popup type feat: 为弹出窗口添加 windowTitle 属性 为 PanelMenu、PanelPopup 和 PanelToolTip QML 组件添加了 windowTitle 属性,以便窗口管理器(如 KWin)能够区分不同的弹出窗口。将标题属性从 PanelPopupWindow.qml 移动到各个组件定义中,允许按弹出类型进行自定义。这 使合成器能够更好地进行窗口管理和识别。 Log: 为面板弹出窗口添加窗口标题支持以改善窗口管理器兼容性 Influence: 1. 测试面板菜单、弹出窗口和工具提示是否显示正确的窗口标题 2. 验证窗口管理器能否正确识别和管理不同类型的弹出窗口 3. 检查弹出窗口定位和功能是否保持不变 4. 使用不同的窗口管理器测试以确保兼容性 5. 验证每个弹出类型的默认窗口标题是否正确设置
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a configurable windowTitle property to panel-related QML popup components so each popup type sets its own WM_NAME before showing, improving window manager identification, and removes the hard-coded title from the shared popup window wrapper. Sequence diagram for setting windowTitle before showing panel popup windowssequenceDiagram
actor User
participant PanelComponent
participant PopupWindow
participant WindowManager
User->>PanelComponent: triggerPopup()
PanelComponent->>PanelComponent: check readyBinding
alt binding_ready
PanelComponent->>PopupWindow: set currentItem
PanelComponent->>PopupWindow: set title = windowTitle
PanelComponent->>PopupWindow: show()
opt requires_activation
PanelComponent->>PopupWindow: requestActivate()
end
PopupWindow-->>WindowManager: expose WM_NAME_from_title
WindowManager->>WindowManager: identify_and_manage_popup()
else binding_not_ready
PanelComponent-->>User: do_not_show_popup()
end
Class diagram for panel popup QML components with windowTitleclassDiagram
class PanelMenu {
int menuX
int menuY
bool readyBinding
string windowTitle
showMenu()
}
class PanelPopup {
int popupX
int popupY
bool readyBinding
string windowTitle
showPopup()
}
class PanelToolTip {
int toolTipX
int toolTipY
bool readyBinding
string windowTitle
showToolTip()
}
class PanelPopupWindow {
int width
int height
int flags
font font
show()
requestActivate()
}
PanelMenu --> PanelPopupWindow : uses menuWindow
PanelPopup --> PanelPopupWindow : uses popupWindow
PanelToolTip --> PanelPopupWindow : uses toolTipWindow
class WindowManager {
identifyWindow()
manageWindow()
}
PanelPopupWindow --> WindowManager : exposes WM_NAME_via_title
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这段代码变更主要涉及QML文件中窗口标题属性的调整和版权年份的更新。以下是对代码的详细审查意见: 1. 语法逻辑审查优点:
建议:
2. 代码质量审查优点:
建议:
3. 代码性能审查分析:
建议:
4. 代码安全审查分析:
建议:
5. 其他建议
改进后的代码示例以 // SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later
Item {
// ... 其他属性 ...
property string windowTitle: qsTr("dde-shell/panelmenu") // 支持国际化
// ... 其他代码 ...
Component.onCompleted: {
menuWindow.title = windowTitle // 在窗口创建时设置标题
}
function open() {
menuWindow.currentItem = control
Qt.callLater(function () {
menuWindow.show() // 显示窗口
DS.grabMouse(menuWindow)
})
}
}总结这段代码变更整体质量良好,主要改进了窗口标题的管理方式。建议进一步统一处理方式、减少代码重复,并考虑国际化和性能优化。 |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Instead of imperatively assigning
*.title = windowTitleinsideshow()/open()paths, consider using a declarative binding liketitle: windowTitleon the window objects so that title updates propagate automatically ifwindowTitlechanges while the popup is visible. - The
windowTitleWM_NAME strings are currently hard-coded separately in three components; consider centralizing them (e.g., in a shared constants file or via a common base component) to avoid divergence and make future adjustments easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Instead of imperatively assigning `*.title = windowTitle` inside `show()`/`open()` paths, consider using a declarative binding like `title: windowTitle` on the window objects so that title updates propagate automatically if `windowTitle` changes while the popup is visible.
- The `windowTitle` WM_NAME strings are currently hard-coded separately in three components; consider centralizing them (e.g., in a shared constants file or via a common base component) to avoid divergence and make future adjustments easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
Added windowTitle property to PanelMenu, PanelPopup, and
PanelToolTip QML components to distinguish different popup windows
for window managers like KWin. The title property was moved from
PanelPopupWindow.qml to individual component definitions to allow
customization per popup type. This enables better window management and
identification in compositors.
Log: Added window title support for panel popup windows to improve
window manager compatibility
Influence:
their respective window titles
popup types
popup type
feat: 为弹出窗口添加 windowTitle 属性
为 PanelMenu、PanelPopup 和 PanelToolTip QML 组件添加了 windowTitle
属性,以便窗口管理器(如 KWin)能够区分不同的弹出窗口。将标题属性从
PanelPopupWindow.qml 移动到各个组件定义中,允许按弹出类型进行自定义。这
使合成器能够更好地进行窗口管理和识别。
Log: 为面板弹出窗口添加窗口标题支持以改善窗口管理器兼容性
Influence:
Summary by Sourcery
Add configurable window titles for panel popup-related QML components to improve identification and handling by window managers.
New Features:
Enhancements: