feat: add DConfig toggle to enable/disable launchpad - #788
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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. Introduce a new `enableLaunchpad` DConfig key under org.deepin.ds.launchpad 2. Read config on startup and react to value changes via DConfig notifications 3. Disabled launchpad hides dock entry, closes open launchpad, and ignores show/toggle requests 4. Add `enabled` property and signal to LauncherController for QML binding 5. Update QML launcheritem to use `shouldVisible` bound to `LauncherController.enabled` 6. Add JSON schema entry for the new config with Chinese translations Log: Added enableLaunchpad DConfig option to control launchpad availability Influence: 1. Test setting enableLaunchpad to false when launchpad is open; verify it closes and dock entry hides 2. Test toggle and show requests when disabled; verify they are ignored 3. Test setting enableLaunchpad to true when disabled; verify dock entry reappears and launchpad can be opened 4. Test DConfig value changes are applied immediately via signal 5. Test creating DConfig file scenarios (invalid/missing) and verify enabled state defaults properly 6. Test QML UI reactive update based on `shouldVisible` property 7. Verify no regressions in existing launchpad show/toggle/close behavior feat: 添加控制启动器开关的DConfig配置项 1. 在 org.deepin.ds.launchpad 下新增 enableLaunchpad DConfig 键 2. 启动时读取配置,并通过 DConfig 通知响应值变化 3. 禁用启动器时隐藏任务栏图标、关闭已打开的启动器、忽略显示/切换请求 4. 为 LauncherController 添加 enabled 属性及其信号,供 QML 绑定 5. 更新 QML launcheritem,将 shouldVisible 绑定到 LauncherController.enabled 6. 新增 JSON schema 配置描述,包含中文翻译 Log: 新增 enableLaunchpad DConfig 选项以控制启动器可用性 Influence: 1. 测试在启动器打开时设置 enableLaunchpad 为 false,验证启动器关闭且任务 栏入口隐藏 2. 测试在禁用状态下发起显示/切换请求,验证请求被忽略 3. 测试在禁用后设置 enableLaunchpad 为 true,验证任务栏入口重新出现且可 打开启动器 4. 测试通过信号实时应用 DConfig 值变化 5. 测试 DConfig 文件异常场景(无效/缺失),验证 enabled 状态的默认处理 6. 测试 QML UI 根据 shouldVisible 属性的响应式更新 7. 验证现有启动器显示/切换/关闭功能无回归 PMS: TASK-393299
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 --- a/shell-launcher-applet/package/launcheritem.qml
+++ b/shell-launcher-applet/package/launcheritem.qml
@@ -21,7 +21,8 @@ AppletItem {
id: launcher
property bool useColumnLayout: Panel.position % 2
property int dockOrder: 12
- property bool shouldVisible: LauncherController.enabled
+ // 确保 shouldVisible 被实际应用到组件的 visible 属性上
+ visible: LauncherController.enabled
// 1:4 the distance between app : dock height; get width/height≈0.8
implicitWidth: useColumnLayout ? Panel.rootObject.dockSize : Panel.rootObject.dockItemMaxSize * 0.8
implicitHeight: useColumnLayout ? Panel.rootObject.dockItemMaxSize * 0.8 : Panel.rootObject.dockSize |
| "permissions": "readwrite", | ||
| "visibility": "private" | ||
| }, | ||
| "enableLaunchpad": { |
There was a problem hiding this comment.
这个是要禁用启动器的模块么?需要实时生效么,
是不是可以把这个逻辑移动到dde-shell里,放到applet里去实现,通过subpath的方式获取配置,支持override,
enableLaunchpadDConfig key under org.deepin.ds.launchpadenabledproperty and signal to LauncherController for QML bindingshouldVisiblebound toLauncherController.enabledLog: Added enableLaunchpad DConfig option to control launchpad availability
Influence:
shouldVisiblepropertyfeat: 添加控制启动器开关的DConfig配置项
Log: 新增 enableLaunchpad DConfig 选项以控制启动器可用性
Influence:
PMS: TASK-393299
Summary by Sourcery
Add a DConfig-backed switch to control launchpad availability and expose it to QML so the dock entry and launcher behavior react dynamically to configuration changes.
New Features:
enableLaunchpadDConfig option underorg.deepin.ds.launchpadto enable or disable the launchpad at runtime.enabledproperty and signal onLauncherControllerfor QML to reflect the launchpad availability in the UI.Enhancements:
LauncherController.enabledproperty so the dock entry hides when launchpad is disabled.enableLaunchpadDConfig key and example usage in the DConfig documentation.