fix: correct touchscreen right-click menu interaction#1482
fix: correct touchscreen right-click menu interaction#1482deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Changed the right-click menu trigger from onTapped to onPressedChanged in two TapHandler instances within NotifyViewDelegate.qml. The previous implementation using onTapped caused incorrect behavior on touchscreen devices where the right-click menu would appear and immediately disappear. The new implementation triggers the menu when the button is pressed (pressed becomes true) rather than when the tap is completed, ensuring proper menu display on touchscreen devices. Log: Fixed touchscreen right-click menu interaction issue where menus would not stay open Influence: 1. Test right-click menu behavior on touchscreen devices 2. Verify menu appears and remains visible when right-clicking notifications 3. Test that menu functionality remains unchanged for mouse users 4. Verify menu positioning is correct relative to the touch point 5. Test interaction with different notification types in the notification center fix: 修正触摸屏右键菜单交互问题 将 NotifyViewDelegate.qml 中两个 TapHandler 实例的右键菜单触发方式从 onTapped 改为 onPressedChanged。之前的实现使用 onTapped 会导致在触摸屏设 备上右键菜单出现后立即消失的问题。新的实现方式在按钮按下时(pressed 变为 true)触发菜单显示,而不是在点击完成时触发,确保在触摸屏设备上菜单能正确 显示。 Log: 修复触摸屏右键菜单交互问题,解决菜单无法保持打开状态的问题 Influence: 1. 在触摸屏设备上测试右键菜单行为 2. 验证右键点击通知时菜单出现并保持可见 3. 测试鼠标用户的菜单功能是否保持不变 4. 验证菜单位置相对于触摸点的定位是否正确 5. 测试通知中心中不同类型通知的交互 PMS: BUG-352017
Reviewer's guide (collapsed on small PRs)Reviewer's GuideSwitches right-click notification menu handling in NotifyViewDelegate.qml from tap-completion to press-state changes so that context menus stay open on touchscreens, while preserving mouse behavior and positioning. Sequence diagram for updated touchscreen right-click menu handlingsequenceDiagram
actor User
participant Touchscreen
participant NotifyViewDelegate
participant TapHandler
participant ContextMenu
User->>Touchscreen: Long-press or right-tap notification
Touchscreen->>NotifyViewDelegate: Pointer event with right button
NotifyViewDelegate->>TapHandler: Handle event (acceptedButtons Qt.RightButton)
TapHandler-->>TapHandler: pressed becomes true
TapHandler->>TapHandler: onPressedChanged()
TapHandler->>NotifyViewDelegate: setting(point.position)
NotifyViewDelegate->>ContextMenu: showAt(position)
ContextMenu-->>User: Menu remains visible until dismissed
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. 代码安全
改进建议
总结这段代码在语法上是正确的,性能上没有问题。主要的变更在于交互逻辑的时机(从“抬起触发”变为“按下触发”)。建议根据产品的具体交互规范决定是否采纳此修改。如果是为了模仿桌面系统的原生右键菜单行为(通常是按下时弹出),这是一个合理的改进。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Changed the right-click menu trigger from onTapped to onPressedChanged
in two TapHandler instances within NotifyViewDelegate.qml. The previous
implementation using onTapped caused incorrect behavior on touchscreen
devices where the right-click menu would appear and immediately
disappear. The new implementation triggers the menu when the button is
pressed (pressed becomes true) rather than when the tap is completed,
ensuring proper menu display on touchscreen devices.
Log: Fixed touchscreen right-click menu interaction issue where menus
would not stay open
Influence:
notifications
notification center
fix: 修正触摸屏右键菜单交互问题
将 NotifyViewDelegate.qml 中两个 TapHandler 实例的右键菜单触发方式从
onTapped 改为 onPressedChanged。之前的实现使用 onTapped 会导致在触摸屏设
备上右键菜单出现后立即消失的问题。新的实现方式在按钮按下时(pressed 变为
true)触发菜单显示,而不是在点击完成时触发,确保在触摸屏设备上菜单能正确
显示。
Log: 修复触摸屏右键菜单交互问题,解决菜单无法保持打开状态的问题
Influence:
PMS: BUG-352017
Summary by Sourcery
Bug Fixes: