Skip to content

Commit c691532

Browse files
18202781743deepin-bot[bot]
authored andcommitted
fix: remove redundant focus property in notification center
Removed explicit focus: true from OverlapNotify component as it was causing focus issues when multiple notifications are present. Added focus management to the main view container to clear focus when NotificationCenter is closed. Replaced Control with FocusScope in NotifyItemContent to better handle focus behavior and simplified the close button visibility logic. Log: Fixed focus issues in notification center Influence: 1. Test notification center opening and closing behavior 2. Verify focus transitions between notifications 3. Check close button visibility and functionality 4. Test keyboard navigation through notifications 5. Verify focus is properly cleared when center is closed fix: 修复通知中心的焦点问题 移除了OverlapNotify组件中显式的focus: true属性,该属性在多个通知同时存在 时会导致焦点问题。为主视图容器添加了焦点管理,在通知中心关闭时清除焦点。 将NotifyItemContent中的Control替换为FocusScope以更好地处理焦点行为,并简 化了关闭按钮的可见性逻辑。 Log: 修复通知中心的焦点问题 Influence: 1. 测试通知中心打开和关闭行为 2. 验证通知之间的焦点转换 3. 检查关闭按钮的可见性和功能 4. 测试通过键盘在通知间的导航 5. 验证通知中心关闭时焦点是否正确清除 PMS: BUG-284139
1 parent f09556b commit c691532

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

panels/notification/center/NotifyViewDelegate.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ DelegateChooser {
120120
OverlapNotify {
121121
id: overlapNotify
122122
objectName: "overlap-" + model.appName
123-
focus: true
124123
width: 360
125124
activeFocusOnTab: true
126125

panels/notification/center/package/main.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Window {
8181
Item {
8282
id: view
8383
width: parent.width
84+
// clear focus when NotificationCenter is closed.
85+
focus: root.visible
8486
anchors {
8587
top: parent.top
8688
left: parent.left

panels/notification/plugin/NotifyItemContent.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ NotifyItem {
4242
}
4343

4444
// placeHolder to receive MouseEvent
45-
Control {
46-
id: closePlaceHolder
45+
FocusScope {
4746
focus: true
4847
anchors {
4948
top: parent.top
@@ -53,14 +52,15 @@ NotifyItem {
5352
}
5453
width: 20
5554
height: 20
56-
contentItem: Loader {
57-
active: !(root.strongInteractive && root.actions.length > 0) && (root.closeVisible || closePlaceHolder.hovered || closePlaceHolder.activeFocus || activeFocus)
55+
56+
Loader {
57+
active: !(root.strongInteractive && root.actions.length > 0) && (root.closeVisible || activeFocus)
5858
sourceComponent: SettingActionButton {
5959
id: closeBtn
6060
objectName: "closeNotify-" + root.appName
6161
icon.name: "clean-alone"
6262
padding: 2
63-
forcusBorderVisible: visualFocus || closePlaceHolder.visualFocus
63+
forcusBorderVisible: visualFocus
6464
onClicked: function () {
6565
root.remove()
6666
}

0 commit comments

Comments
 (0)