Skip to content

Commit e1bfe70

Browse files
Ivy233deepin-bot[bot]
authored andcommitted
fix: restore checkbox binding after menu item triggered
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
1 parent 3db223c commit e1bfe70

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

panels/dock/package/main.qml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,10 @@ Window {
265265
text: name
266266

267267
onTriggered: {
268-
if (Applet[prop] !== value) {
269-
Applet[prop] = value
270-
}
268+
Applet[prop] = value
269+
checked = Qt.binding(function() {
270+
return Applet[prop] === value
271+
})
271272
}
272273
checked: Applet[prop] === value
273274
}

0 commit comments

Comments
 (0)