From 88fc663001dade4bcbdec29b6dde3d65d56a351a Mon Sep 17 00:00:00 2001 From: Ivy233 Date: Thu, 5 Feb 2026 10:00:21 +0800 Subject: [PATCH] fix: restore checkbox binding after menu item triggered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Removed conditional check in onTriggered handler that prevented property updates when value was already set 2. Added explicit Qt.binding restoration for checked property after setting the value 3. This ensures checkbox state remains synchronized with Applet property even after user interaction 4. Fixes issue where checkbox state could become desynchronized from actual property value after menu item is triggered Log: Fixed dock menu checkbox state synchronization issue Influence: 1. Test dock menu items with checkbox to ensure state updates correctly 2. Verify checkbox reflects actual property value after clicking 3. Test multiple clicks on same menu item to ensure binding persists 4. Verify checkbox state updates when property changes from other sources 5. Test with different dock menu options (position, display mode, etc.) fix: 修复菜单项触发后复选框绑定问题 1. 移除了 onTriggered 处理器中的条件检查,该检查会在值已设置时阻止属性更新 2. 在设置值后添加了显式的 Qt.binding 恢复,用于 checked 属性 3. 确保复选框状态在用户交互后仍与 Applet 属性保持同步 4. 修复了菜单项触发后复选框状态可能与实际属性值不同步的问题 Log: 修复了任务栏菜单复选框状态同步问题 Influence: 1. 测试带复选框的任务栏菜单项,确保状态正确更新 2. 验证点击后复选框反映实际属性值 3. 测试多次点击同一菜单项,确保绑定持续有效 4. 验证属性从其他来源更改时复选框状态更新 5. 测试不同的任务栏菜单选项(位置、显示模式等) PMS: BUG-349947 --- panels/dock/package/main.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 456bbd6b3..fb477d49d 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -265,9 +265,10 @@ Window { text: name onTriggered: { - if (Applet[prop] !== value) { - Applet[prop] = value - } + Applet[prop] = value + checked = Qt.binding(function() { + return Applet[prop] === value + }) } checked: Applet[prop] === value }