feat: add DConfig toggles for dock context menu and docked applications - #1674
Conversation
| auto pair = elementInfo.split('/'); | ||
| if (pair.size() != 2) | ||
| continue; | ||
| if (TaskManagerSettings::instance()->dockedApplicationsEnabled()) { |
There was a problem hiding this comment.
dockedApplicationsEnabled 如果为false,后面的都不用执行了吧,
There was a problem hiding this comment.
最后一部分是在 禁用驻留的时候, 保证任务栏已驻留应用能够消失 的判断。
|
[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 |
1. Add DConfig "enableContextMenu" to control the dock empty area context menu and touch-and-hold menu. The setting is applied in QML to conditionally show/hide the menu. 2. Add DConfig "enableDockedApplications" to control docked applications on the taskbar. When disabled, non-running docked apps are hidden, docking changes are rejected, but the saved list is preserved. The setting propagates through C++ models and settings classes to block dock/undock requests and menu items. 3. Update DConfig JSON files for both dock and taskmanager with appropriate metadata and translations. 4. Add signals and properties for both settings in DockPanel, DockSettings, and TaskManagerSettings. 5. Refactor DockGlobalElementModel::loadDockedElements to conditionally load docked elements based on the setting. 6. Modify desktop file parsers and task manager to check the setting before allowing dock/undock operations. 7. Update QML to close open context menu if disabled during runtime. Log: Added DConfig options to enable/disable dock empty area context menu and docked applications. Influence: 1. Test dock empty area context menu with enableContextMenu set to true and false. 2. Test dock touch-and-hold menu on tablets with enableContextMenu. 3. Test docked applications with enableDockedApplications set to true and false. 4. Verify non-running docked applications are hidden when disabled. 5. Verify dock/undock operations are blocked when disabled. 6. Verify the saved docked application list is preserved when toggling the setting. 7. Test that opening dock menu is prevented when disabled at runtime. 8. Test that currently open dock menu is closed when setting is disabled. feat: 添加任务栏右键菜单和驻留应用功能的DConfig开关 1. 添加DConfig配置项"enableContextMenu",控制任务栏空白区域右键菜单及触 摸长按菜单的显示与隐藏,该设置在QML中条件启用。 2. 添加DConfig配置项"enableDockedApplications",控制任务栏驻留应用。禁用 时,隐藏未运行的驻留应用并拒绝驻留状态更改,但保留已保存的驻留列表。该设 置通过C++模型和设置类传播,阻止驻留/取消驻留请求及菜单项。 3. 更新任务栏和任务管理器的DConfig JSON文件,包含元数据和翻译。 4. 在DockPanel、DockSettings和TaskManagerSettings中添加对应信号和属性。 5. 重构DockGlobalElementModel::loadDockedElements,根据设置条件加载驻留 元素。 6. 修改桌面文件解析器和任务管理器,在执行驻留/取消驻留操作前检查该设置。 7. 在QML中,若运行时禁用设置,则关闭已打开的任务栏菜单。 Log: 新增DConfig选项,用于启用或禁用任务栏空白区域右键菜单和驻留应用 功能。 Influence: 1. 测试enableContextMenu分别为true和false时,任务栏空白区域右键菜单是否 正常显示或隐藏。 2. 测试平板模式下enableContextMenu对触摸长按菜单的影响。 3. 测试enableDockedApplications分别为true和false时,驻留应用的状态。 4. 验证禁用后,未运行的驻留应用是否被隐藏。 5. 验证禁用后,驻留/取消驻留操作是否被阻止。 6. 验证切换设置时,已保存的驻留应用列表是否被保留。 7. 测试运行时禁用设置时,打开任务栏菜单是否被阻止。 8. 测试运行时禁用设置时,已打开的任务栏菜单是否被关闭。 PMS: TASK-393299
deepin pr auto review★ 总体评分:92分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 --- a/panels/dock/package/main.qml
+++ b/panels/dock/package/main.qml
@@ -433,10 +433,9 @@ Window {
onTapped: function(eventPoint, button) {
let lastActive = MenuHelper.activeMenu
MenuHelper.closeCurrent()
- if (button === Qt.RightButton && Panel.contextMenuEnabled) {
+ if (button === Qt.RightButton && Panel.contextMenuEnabled && lastActive !== dockMenuLoader.item) {
dockMenuLoader.active = true
- }
- if (button === Qt.RightButton && Panel.contextMenuEnabled && lastActive !== dockMenuLoader.item) {
requestShowDockMenu()
}
if (button === Qt.LeftButton) { |
Log: Added DConfig options to enable/disable dock empty area context menu and docked applications.
Influence:
feat: 添加任务栏右键菜单和驻留应用功能的DConfig开关
置通过C++模型和设置类传播,阻止驻留/取消驻留请求及菜单项。
Log: 新增DConfig选项,用于启用或禁用任务栏空白区域右键菜单和驻留应用
功能。
Influence:
PMS: TASK-393299