From a38e16a572fcb3a93a8a4c34a1f2f7ef2e1b4fde Mon Sep 17 00:00:00 2001 From: Fangxun Zhao Date: Wed, 28 Oct 2026 18:19:41 +0800 Subject: [PATCH] Revert "fix(a11y): fix Accessible.id crash and compile warning" This reverts commit 72b624a1b01bc274e0a89dd9e0c11ddbce6c6929, except for the m_ActiveId int -> uint change, which is kept to avoid the sign-compare error under -Werror. The Accessible.id workaround is no longer needed: the Qt fix removing REVISION(6, 8) from Accessible.id has already landed in the integration environment, so the static Accessible.id bindings work again. https://github.com/deepin-community/qt6-declarative/pull/37/changes#diff-93467241211d3f9d253fb8ad341738fbda5e5d3ade4721326f2bba82525fbaee --- panels/dock/OverflowContainer.qml | 2 +- .../appruntimeitem/package/appruntimeitem.qml | 4 ++-- panels/dock/appruntimeitem/windowmanager.h | 2 +- .../multitaskview/package/multitaskview.qml | 2 +- panels/dock/package/main.qml | 6 ++--- .../dock/showdesktop/package/showdesktop.qml | 2 +- panels/dock/taskmanager/package/AppItem.qml | 10 ++++----- .../dock/taskmanager/package/TaskManager.qml | 4 ++-- panels/dock/tray/SurfacePopup.qml | 10 ++++----- panels/dock/tray/SurfaceSubPopup.qml | 4 ++-- panels/dock/tray/TrayItemSurfacePopup.qml | 14 ++++++------ .../ActionLegacyTrayPluginDelegate.qml | 4 ++-- .../tray/package/ActionShowStashDelegate.qml | 2 +- .../package/ActionToggleCollapseDelegate.qml | 2 +- panels/dock/tray/package/DummyDelegate.qml | 2 +- panels/dock/tray/package/StashContainer.qml | 2 +- .../package/StashedItemDelegateChooser.qml | 16 +++++++------- .../tray/package/TrayItemDelegateChooser.qml | 22 +++++++++---------- panels/dock/tray/package/tray.qml | 6 ++--- panels/dock/tray/quickpanel/DragItem.qml | 2 +- .../dock/tray/quickpanel/PanelPluginPage.qml | 2 +- panels/dock/tray/quickpanel/PanelTrayItem.qml | 4 ++-- panels/dock/tray/quickpanel/PluginItem.qml | 4 ++-- panels/dock/tray/quickpanel/QuickPanel.qml | 10 ++++----- .../dock/tray/quickpanel/QuickPanelPage.qml | 4 ++-- panels/dock/tray/quickpanel/SubPluginPage.qml | 2 +- panels/notification/bubble/package/Bubble.qml | 2 +- panels/notification/bubble/package/main.qml | 4 ++-- panels/notification/center/GroupNotify.qml | 10 ++++----- panels/notification/center/NormalNotify.qml | 4 ++-- panels/notification/center/NotifyCenter.qml | 6 ++--- panels/notification/center/NotifyHeader.qml | 10 ++++----- .../center/NotifyHeaderTitleText.qml | 2 +- panels/notification/center/NotifySetting.qml | 4 ++-- panels/notification/center/NotifyStaging.qml | 4 ++-- panels/notification/center/NotifyView.qml | 4 ++-- .../center/NotifyViewDelegate.qml | 8 +++---- panels/notification/center/OverlapNotify.qml | 6 ++--- panels/notification/center/package/main.qml | 4 ++-- .../osd/displaymode/package/main.qml | 4 ++-- .../osd/kblayout/package/main.qml | 4 ++-- .../osd/windoweffect/package/main.qml | 4 ++-- panels/notification/plugin/NotifyAction.qml | 2 +- .../notification/plugin/NotifyItemContent.qml | 6 ++--- 44 files changed, 116 insertions(+), 116 deletions(-) diff --git a/panels/dock/OverflowContainer.qml b/panels/dock/OverflowContainer.qml index cfc936f29..eb3604fcd 100644 --- a/panels/dock/OverflowContainer.qml +++ b/panels/dock/OverflowContainer.qml @@ -20,7 +20,7 @@ Item { property alias removeDisplaced: listView.removeDisplaced property alias moveDisplaced: listView.moveDisplaced ListView { - Component.onCompleted: { Accessible.id = "ListView" } + Accessible.id: "ListView" id: listView anchors.fill: parent orientation: useColumnLayout ? ListView.Vertical : ListView.Horizontal diff --git a/panels/dock/appruntimeitem/package/appruntimeitem.qml b/panels/dock/appruntimeitem/package/appruntimeitem.qml index b6a2e442f..68fdcab4e 100644 --- a/panels/dock/appruntimeitem/package/appruntimeitem.qml +++ b/panels/dock/appruntimeitem/package/appruntimeitem.qml @@ -21,7 +21,7 @@ AppletItem { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "Appruntime" } + Accessible.id: "Appruntime" id: toolTip text: qsTr("appruntime") toolTipX: DockPanelPositioner.x @@ -29,7 +29,7 @@ AppletItem { } AppletItemButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "Button" } + Accessible.id: "Button" id: button anchors.centerIn: parent icon.name: "qrc:/ddeshell/package/icons/appruntime.svg" diff --git a/panels/dock/appruntimeitem/windowmanager.h b/panels/dock/appruntimeitem/windowmanager.h index 01f4ec413..724b5cd0f 100644 --- a/panels/dock/appruntimeitem/windowmanager.h +++ b/panels/dock/appruntimeitem/windowmanager.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later diff --git a/panels/dock/multitaskview/package/multitaskview.qml b/panels/dock/multitaskview/package/multitaskview.qml index 2e2b524c2..6b369943d 100644 --- a/panels/dock/multitaskview/package/multitaskview.qml +++ b/panels/dock/multitaskview/package/multitaskview.qml @@ -18,7 +18,7 @@ AppletDockItem { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "MultitaskingView" } + Accessible.id: "MultitaskingView" id: toolTip text: qsTr("Multitasking View") toolTipX: DockPanelPositioner.x diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 16ebeb97a..e34e36a52 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -635,7 +635,7 @@ Window { Accessible.name: qsTr("Dock Left Area") OverflowContainer { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "LeftLoader" } + Accessible.id: "LeftLoader" id: leftLoader anchors.fill: parent useColumnLayout: dock.useColumnLayout @@ -685,7 +685,7 @@ Window { OverflowContainer { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "CenterLoader" } + Accessible.id: "CenterLoader" id: centerLoader anchors.fill: parent useColumnLayout: dock.useColumnLayout @@ -715,7 +715,7 @@ Window { anchors.bottom: parent.bottom OverflowContainer { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "RightLoader" } + Accessible.id: "RightLoader" id: rightLoader anchors.fill: parent useColumnLayout: dock.useColumnLayout diff --git a/panels/dock/showdesktop/package/showdesktop.qml b/panels/dock/showdesktop/package/showdesktop.qml index 2b18f14e1..cfb911f88 100644 --- a/panels/dock/showdesktop/package/showdesktop.qml +++ b/panels/dock/showdesktop/package/showdesktop.qml @@ -22,7 +22,7 @@ AppletItem { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "ShowDesktop" } + Accessible.id: "ShowDesktop" id: toolTip text: qsTr("show desktop") toolTipX: DockPanelPositioner.x diff --git a/panels/dock/taskmanager/package/AppItem.qml b/panels/dock/taskmanager/package/AppItem.qml index 32755fa34..4cc7c3d3c 100644 --- a/panels/dock/taskmanager/package/AppItem.qml +++ b/panels/dock/taskmanager/package/AppItem.qml @@ -81,7 +81,7 @@ Item { AppItemPalette { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "ItemPalette" } + Accessible.id: "ItemPalette" id: itemPalette displayMode: root.displayMode colorTheme: root.colorTheme @@ -263,6 +263,7 @@ Item { WindowIndicator { Accessible.role: Accessible.Indicator + Accessible.id: "WindowIndicator" id: windowIndicator dotWidth: root.useColumnLayout ? Math.max(iconSize / 16, 2) : Math.max(iconSize / 3, 2) dotHeight: root.useColumnLayout ? Math.max(iconSize / 3, 2) : Math.max(iconSize / 16, 2) @@ -316,13 +317,12 @@ Item { Component.onCompleted: { windowIndicator.updateIndicatorAnchors() - Accessible.id = "WindowIndicator" } } AppItemTitle { Accessible.role: Accessible.StaticText - Component.onCompleted: { Accessible.id = "TitleLoader" } + Accessible.id: "TitleLoader" id: titleLoader anchors.left: iconContainer.right anchors.leftMargin: Math.round(root.iconSize / 8) @@ -634,7 +634,7 @@ Item { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "ToolTip" } + Accessible.id: "ToolTip" id: toolTip toolTipX: DockPanelPositioner.x toolTipY: DockPanelPositioner.y @@ -642,7 +642,7 @@ Item { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "MoveToTrash" } + Accessible.id: "MoveToTrash" id: dragToolTip text: qsTr("Move to Trash") toolTipX: DockPanelPositioner.x diff --git a/panels/dock/taskmanager/package/TaskManager.qml b/panels/dock/taskmanager/package/TaskManager.qml index 31c4e6440..c0e1bdaa9 100644 --- a/panels/dock/taskmanager/package/TaskManager.qml +++ b/panels/dock/taskmanager/package/TaskManager.qml @@ -119,7 +119,7 @@ ContainmentItem { OverflowContainer { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "AppContainer" } + Accessible.id: "AppContainer" id: appContainer anchors.fill: parent anchors.leftMargin: useColumnLayout ? 0 : taskmanager.startPadding @@ -229,6 +229,7 @@ ContainmentItem { AppItem { Accessible.role: Accessible.ListItem + Accessible.id: "AppItem" id: appItem anchors.fill: parent // This is mandatory for draggable item center in drop area @@ -252,7 +253,6 @@ ContainmentItem { ListView.delayRemove: Drag.active Component.onCompleted: { dropFilesOnItem.connect(taskmanager.Applet.dropFilesOnItem) - Accessible.id = "AppItem" } onDragFinished: function() { launcherDndDropArea.resetDndState() diff --git a/panels/dock/tray/SurfacePopup.qml b/panels/dock/tray/SurfacePopup.qml index e9c4dce4c..e4d732683 100644 --- a/panels/dock/tray/SurfacePopup.qml +++ b/panels/dock/tray/SurfacePopup.qml @@ -19,7 +19,7 @@ Item { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "ToolTip" } + Accessible.id: "ToolTip" id: toolTip onToolTipVisibleChanged: function (visible) { if (visible && menuWindow.visible) @@ -29,7 +29,7 @@ Item { property alias shellSurface: surfaceLayer.shellSurface ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "SurfaceLayer" } + Accessible.id: "SurfaceLayer" id: surfaceLayer anchors.centerIn: parent autoClose: true @@ -53,7 +53,7 @@ Item { } PanelMenu { Accessible.role: Accessible.PopupMenu - Component.onCompleted: { Accessible.id = "Menu" } + Accessible.id: "Menu" id: menu width: menuSurfaceLayer.width height: menuSurfaceLayer.height @@ -62,7 +62,7 @@ Item { property alias shellSurface: menuSurfaceLayer.shellSurface ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "MenuSurfaceLayer" } + Accessible.id: "MenuSurfaceLayer" id: menuSurfaceLayer anchors.centerIn: parent autoClose: true @@ -85,7 +85,7 @@ Item { active: false sourceComponent: SurfaceSubPopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "SurfaceSubPopup" } + Accessible.id: "SurfaceSubPopup" objectName: "stashed's subPopup" transientParent: menuWindow surfaceAcceptor: function (surfaceId) { diff --git a/panels/dock/tray/SurfaceSubPopup.qml b/panels/dock/tray/SurfaceSubPopup.qml index c69e1aecd..06931ba2e 100644 --- a/panels/dock/tray/SurfaceSubPopup.qml +++ b/panels/dock/tray/SurfaceSubPopup.qml @@ -48,7 +48,7 @@ Item { PanelMenu { Accessible.role: Accessible.PopupMenu - Component.onCompleted: { Accessible.id = "Popup" } + Accessible.id: "Popup" id: popup width: popupSurfaceLayer.width height: popupSurfaceLayer.height @@ -57,7 +57,7 @@ Item { property alias shellSurface: popupSurfaceLayer.shellSurface ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "PopupSurfaceLayer" } + Accessible.id: "PopupSurfaceLayer" id: popupSurfaceLayer anchors.centerIn: parent autoClose: true diff --git a/panels/dock/tray/TrayItemSurfacePopup.qml b/panels/dock/tray/TrayItemSurfacePopup.qml index 4ef8a52f1..6baf609f2 100644 --- a/panels/dock/tray/TrayItemSurfacePopup.qml +++ b/panels/dock/tray/TrayItemSurfacePopup.qml @@ -28,7 +28,7 @@ Item { PanelPopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "Popup" } + Accessible.id: "Popup" id: popup property alias shellSurface: popupContent.shellSurface width: popupContent.width @@ -42,7 +42,7 @@ Item { anchors.fill: parent ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "PopupContent" } + Accessible.id: "PopupContent" id: popupContent anchors.centerIn: parent autoClose: true @@ -55,7 +55,7 @@ Item { PanelMenu { Accessible.role: Accessible.PopupMenu - Component.onCompleted: { Accessible.id = "PopupMenu" } + Accessible.id: "PopupMenu" id: popupMenu property alias shellSurface: popupMenuContent.shellSurface width: popupMenuContent.width @@ -76,7 +76,7 @@ Item { anchors.fill: parent ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "PopupMenuContent" } + Accessible.id: "PopupMenuContent" id: popupMenuContent anchors.centerIn: parent autoClose: true @@ -100,7 +100,7 @@ Item { active: false sourceComponent: SurfaceSubPopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "SurfaceSubPopup" } + Accessible.id: "SurfaceSubPopup" objectName: "tray's subPopup" transientParent: popupMenu.menuWindow surfaceAcceptor: function (surfaceId) { @@ -126,7 +126,7 @@ Item { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "ToolTip" } + Accessible.id: "ToolTip" id: toolTip property alias shellSurface: toolTipContent.shellSurface toolTipX: DockPanelPositioner.x @@ -134,7 +134,7 @@ Item { ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "ToolTipContent" } + Accessible.id: "ToolTipContent" id: toolTipContent anchors.centerIn: parent autoClose: true diff --git a/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml b/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml index e6b787b77..62e7e6542 100644 --- a/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml +++ b/panels/dock/tray/package/ActionLegacyTrayPluginDelegate.qml @@ -16,7 +16,7 @@ import org.deepin.ds.dock.tray 1.0 as DDT AppletItemButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "AppletItemButton" } + Accessible.id: "AppletItemButton" id: root property alias inputEventsEnabled: surfaceItem.inputEventsEnabled @@ -86,7 +86,7 @@ AppletItemButton { ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "SurfaceItem" } + Accessible.id: "SurfaceItem" id: surfaceItem anchors.fill: parent shellSurface: pluginItem.plugin diff --git a/panels/dock/tray/package/ActionShowStashDelegate.qml b/panels/dock/tray/package/ActionShowStashDelegate.qml index cb8088fd6..f49d3f4f6 100644 --- a/panels/dock/tray/package/ActionShowStashDelegate.qml +++ b/panels/dock/tray/package/ActionShowStashDelegate.qml @@ -116,7 +116,7 @@ AppletItemButton { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "ApplicationTray" } + Accessible.id: "ApplicationTray" id: toolTip text: qsTr("Application tray") toolTipX: DockPanelPositioner.x diff --git a/panels/dock/tray/package/ActionToggleCollapseDelegate.qml b/panels/dock/tray/package/ActionToggleCollapseDelegate.qml index 1fbd87b70..40fef456e 100644 --- a/panels/dock/tray/package/ActionToggleCollapseDelegate.qml +++ b/panels/dock/tray/package/ActionToggleCollapseDelegate.qml @@ -54,7 +54,7 @@ AppletItemButton { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "CollapseTray" } + Accessible.id: "CollapseTray" id: toolTip text: qsTr("Collapse tray") toolTipX: DockPanelPositioner.x diff --git a/panels/dock/tray/package/DummyDelegate.qml b/panels/dock/tray/package/DummyDelegate.qml index a0f78175f..b2fd7993c 100644 --- a/panels/dock/tray/package/DummyDelegate.qml +++ b/panels/dock/tray/package/DummyDelegate.qml @@ -8,7 +8,7 @@ import org.deepin.ds.dock 1.0 import org.deepin.ds.dock.tray 1.0 as DDT Button { - Component.onCompleted: { Accessible.id = "Button" } + Accessible.id: "Button" icon.name: model.surfaceId icon.width: 16 icon.height: 16 diff --git a/panels/dock/tray/package/StashContainer.qml b/panels/dock/tray/package/StashContainer.qml index 476dd707a..ed64b467f 100644 --- a/panels/dock/tray/package/StashContainer.qml +++ b/panels/dock/tray/package/StashContainer.qml @@ -72,7 +72,7 @@ Item { // tooltip and menu DDT.SurfacePopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "StashSurfacePopup" } + Accessible.id: "StashSurfacePopup" id: stashSurfacePopup objectName: "stash" surfaceAcceptor: isStashPopup diff --git a/panels/dock/tray/package/StashedItemDelegateChooser.qml b/panels/dock/tray/package/StashedItemDelegateChooser.qml index fc9e99406..4c2ad50d8 100644 --- a/panels/dock/tray/package/StashedItemDelegateChooser.qml +++ b/panels/dock/tray/package/StashedItemDelegateChooser.qml @@ -25,10 +25,10 @@ LQM.DelegateChooser { roleValue: "dummy" StashedItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "StashedItemPositioner" } + Accessible.id: "StashedItemPositioner" contentItem: DummyDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "DummyDelegate" } + Accessible.id: "DummyDelegate" } } } @@ -36,11 +36,11 @@ LQM.DelegateChooser { roleValue: "legacy-tray-plugin" StashedItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "StashItemPositioner" } + Accessible.id: "StashItemPositioner" id: stashItemPositioner contentItem: ActionLegacyTrayPluginDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "TrayDelegate" } + Accessible.id: "TrayDelegate" id: trayDelegate objectName: "stash" itemVisible: stashItemPositioner.itemVisible @@ -114,10 +114,10 @@ LQM.DelegateChooser { roleValue: "action-show-stash" StashedItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "StashedItemPositioner" } + Accessible.id: "StashedItemPositioner" contentItem: ActionShowStashDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "ActionShowStashDelegate" } + Accessible.id: "ActionShowStashDelegate" } } } @@ -125,10 +125,10 @@ LQM.DelegateChooser { roleValue: "action-toggle-collapse" StashedItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "StashedItemPositioner" } + Accessible.id: "StashedItemPositioner" contentItem: ActionToggleCollapseDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "ActionToggleCollapseDelegate" } + Accessible.id: "ActionToggleCollapseDelegate" isHorizontal: root.isHorizontal } } diff --git a/panels/dock/tray/package/TrayItemDelegateChooser.qml b/panels/dock/tray/package/TrayItemDelegateChooser.qml index b446d1ee9..3237e6dc3 100644 --- a/panels/dock/tray/package/TrayItemDelegateChooser.qml +++ b/panels/dock/tray/package/TrayItemDelegateChooser.qml @@ -23,11 +23,11 @@ LQM.DelegateChooser { roleValue: "dummy" TrayItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "TrayItemPositioner" } + Accessible.id: "TrayItemPositioner" visualSize: dummyDelegate.visualSize contentItem: DummyDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "DummyDelegate" } + Accessible.id: "DummyDelegate" id: dummyDelegate } } @@ -36,12 +36,12 @@ LQM.DelegateChooser { roleValue: "legacy-tray-plugin" TrayItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "TraySurfacePositioner" } + Accessible.id: "TraySurfacePositioner" id: traySurfacePositioner visualSize: traySurfaceDelegate.visualSize contentItem: ActionLegacyTrayPluginDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "TraySurfaceDelegate" } + Accessible.id: "TraySurfaceDelegate" id: traySurfaceDelegate objectName: "tray" inputEventsEnabled: !disableInputEvents && (model.sectionType !== "collapsable" || !DDT.TraySortOrderModel.isCollapsing) @@ -52,7 +52,7 @@ LQM.DelegateChooser { // trayItem's popup DDT.TrayItemSurfacePopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "SurfacePopup" } + Accessible.id: "SurfacePopup" id: surfacePopup surfaceAcceptor: function (surfaceId) { if (root.surfaceAcceptor && !root.surfaceAcceptor(surfaceId)) @@ -68,10 +68,10 @@ LQM.DelegateChooser { roleValue: "action-show-stash" TrayItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "TrayItemPositioner" } + Accessible.id: "TrayItemPositioner" contentItem: ActionShowStashDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "ActionShowStashDelegate" } + Accessible.id: "ActionShowStashDelegate" } } } @@ -79,10 +79,10 @@ LQM.DelegateChooser { roleValue: "action-toggle-collapse" TrayItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "TrayItemPositioner" } + Accessible.id: "TrayItemPositioner" contentItem: ActionToggleCollapseDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "ActionToggleCollapseDelegate" } + Accessible.id: "ActionToggleCollapseDelegate" isHorizontal: root.isHorizontal inputEventsEnabled: !disableInputEvents } @@ -92,11 +92,11 @@ LQM.DelegateChooser { roleValue: "action-toggle-quick-settings" TrayItemPositioner { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "TrayItemPositioner" } + Accessible.id: "TrayItemPositioner" visualSize: Qt.size(quickSettingsDelegate.width, quickSettingsDelegate.height) ActionToggleQuickSettingsDelegate { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "QuickSettingsDelegate" } + Accessible.id: "QuickSettingsDelegate" id: quickSettingsDelegate isHorizontal: root.isHorizontal } diff --git a/panels/dock/tray/package/tray.qml b/panels/dock/tray/package/tray.qml index 18c35486f..cdbea814c 100644 --- a/panels/dock/tray/package/tray.qml +++ b/panels/dock/tray/package/tray.qml @@ -38,6 +38,7 @@ AppletItem { PanelPopup { Accessible.role: Accessible.Dialog + Accessible.id: "StashedPopup" id: stashedPopup width: stashedContainer.width height: stashedContainer.height @@ -59,7 +60,7 @@ AppletItem { padding: 10 contentItem: StashContainer { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "StashContainer" } + Accessible.id: "StashContainer" id: stashContainer color: "transparent" model: DDT.SortFilterProxyModel { @@ -90,7 +91,6 @@ AppletItem { DockPanelPositioner.bounding = Qt.binding(function () { return Qt.rect(collapsedBtnCenterPoint.x, collapsedBtnCenterPoint.y, stashedPopup.width, stashedPopup.height) }) - Accessible.id = "StashedPopup" } } Connections { @@ -134,6 +134,7 @@ AppletItem { TrayContainer { Accessible.role: Accessible.Pane + Accessible.id: "TrayContainter" id: trayContainter isHorizontal: !tray.useColumnLayout model: DDT.TraySortOrderModel @@ -143,7 +144,6 @@ AppletItem { color: "transparent" Component.onCompleted: { DDT.TrayItemPositionManager.layoutHealthCheck(1500) - Accessible.id = "TrayContainter" } // 拖拽成功移入 stash 时由 TrayContainer 回调(命中 action-show-stash) onStashDropSucceeded: function() { diff --git a/panels/dock/tray/quickpanel/DragItem.qml b/panels/dock/tray/quickpanel/DragItem.qml index 79a704a66..6f13b5119 100644 --- a/panels/dock/tray/quickpanel/DragItem.qml +++ b/panels/dock/tray/quickpanel/DragItem.qml @@ -123,7 +123,7 @@ Item { anchors.verticalCenterOffset: -root.fallbackIconSize.height / 3 * 2 sourceComponent: ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "ShellSurfaceItemProxy" } + Accessible.id: "ShellSurfaceItemProxy" shellSurface: root.fallbackDragImage width: root.fallbackIconSize.width height: root.fallbackIconSize.height diff --git a/panels/dock/tray/quickpanel/PanelPluginPage.qml b/panels/dock/tray/quickpanel/PanelPluginPage.qml index 7fb9cb611..630b1f88e 100644 --- a/panels/dock/tray/quickpanel/PanelPluginPage.qml +++ b/panels/dock/tray/quickpanel/PanelPluginPage.qml @@ -76,7 +76,7 @@ Item { delegate: PluginItem { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "PluginItem" } + Accessible.id: "PluginItem" id: pluginItem width: { if (model.surfaceLayoutType === 4) diff --git a/panels/dock/tray/quickpanel/PanelTrayItem.qml b/panels/dock/tray/quickpanel/PanelTrayItem.qml index 81d4f6431..e02050d4a 100644 --- a/panels/dock/tray/quickpanel/PanelTrayItem.qml +++ b/panels/dock/tray/quickpanel/PanelTrayItem.qml @@ -33,7 +33,7 @@ Control { PanelToolTip { Accessible.role: Accessible.ToolTip - Component.onCompleted: { Accessible.id = "QuickActions" } + Accessible.id: "QuickActions" id: toolTip text: qsTr("Quick actions") toolTipX: DockPanelPositioner.x @@ -95,7 +95,7 @@ Control { ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "SurfaceLayer" } + Accessible.id: "SurfaceLayer" id: surfaceLayer property var itemGlobalPoint: { var a = surfaceLayer diff --git a/panels/dock/tray/quickpanel/PluginItem.qml b/panels/dock/tray/quickpanel/PluginItem.qml index a12b16926..93d3a29b8 100644 --- a/panels/dock/tray/quickpanel/PluginItem.qml +++ b/panels/dock/tray/quickpanel/PluginItem.qml @@ -28,7 +28,7 @@ Control { DragItem { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "DragLayer" } + Accessible.id: "DragLayer" id: dragLayer anchors.fill: parent dragItem: root @@ -53,7 +53,7 @@ Control { ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "SurfaceLayer" } + Accessible.id: "SurfaceLayer" id: surfaceLayer anchors.centerIn: parent anchors.fill: parent diff --git a/panels/dock/tray/quickpanel/QuickPanel.qml b/panels/dock/tray/quickpanel/QuickPanel.qml index 614f73b76..ea5c00e74 100644 --- a/panels/dock/tray/quickpanel/QuickPanel.qml +++ b/panels/dock/tray/quickpanel/QuickPanel.qml @@ -60,7 +60,7 @@ Item { PanelTrayItem { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "PanelTrayItem" } + Accessible.id: "PanelTrayItem" id: panelTrayItem shellSurface: quickpanelModel.trayItemSurface isOpened: popup.popupVisible @@ -77,7 +77,7 @@ Item { PanelPopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "Popup" } + Accessible.id: "Popup" id: popup width: popupContent.width height: popupContent.height @@ -86,13 +86,13 @@ Item { QuickPanelPage { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "PopupContent" } + Accessible.id: "PopupContent" id: popupContent model: quickpanelModel DDT.SurfacePopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "SurfacePopup" } + Accessible.id: "SurfacePopup" objectName: "quickpanel" surfaceAcceptor: function (surfaceId) { let pluginId = pluginIdBySurfaceId(surfaceId) @@ -110,7 +110,7 @@ Item { // trayItem's popup DDT.TrayItemSurfacePopup { Accessible.role: Accessible.Dialog - Component.onCompleted: { Accessible.id = "TrayItemSurfacePopup" } + Accessible.id: "TrayItemSurfacePopup" id: trayItemSurfacePopup surfaceAcceptor: isTrayItemPopup surfaceFilter: function (surfaceId) { diff --git a/panels/dock/tray/quickpanel/QuickPanelPage.qml b/panels/dock/tray/quickpanel/QuickPanelPage.qml index 580a59c9f..950f4e784 100644 --- a/panels/dock/tray/quickpanel/QuickPanelPage.qml +++ b/panels/dock/tray/quickpanel/QuickPanelPage.qml @@ -40,7 +40,7 @@ Item { height: panelView.contentHeight initialItem: PanelPluginPage { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "PanelPage" } + Accessible.id: "PanelPage" id: panelPage model: root.model StackView.onActivating: function () { @@ -56,7 +56,7 @@ Item { id: subPluginPageLoader SubPluginPage { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "SubPluginPage" } + Accessible.id: "SubPluginPage" width: panelPage.width onRequestBack: function () { panelView.pop() diff --git a/panels/dock/tray/quickpanel/SubPluginPage.qml b/panels/dock/tray/quickpanel/SubPluginPage.qml index f12e4bd05..ca30e1836 100644 --- a/panels/dock/tray/quickpanel/SubPluginPage.qml +++ b/panels/dock/tray/quickpanel/SubPluginPage.qml @@ -90,7 +90,7 @@ Item { // content ShellSurfaceItemProxy { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "SurfaceLayer" } + Accessible.id: "SurfaceLayer" id: surfaceLayer autoClose: true Layout.fillWidth: true diff --git a/panels/notification/bubble/package/Bubble.qml b/panels/notification/bubble/package/Bubble.qml index dbc7f892e..8846cf8be 100644 --- a/panels/notification/bubble/package/Bubble.qml +++ b/panels/notification/bubble/package/Bubble.qml @@ -11,7 +11,7 @@ import org.deepin.dtk 1.0 as D NotifyItemContent { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "Bubble" } + Accessible.id: "Bubble" id: control property var bubble diff --git a/panels/notification/bubble/package/main.qml b/panels/notification/bubble/package/main.qml index 29b486ba8..bfaa7837b 100644 --- a/panels/notification/bubble/package/main.qml +++ b/panels/notification/bubble/package/main.qml @@ -91,7 +91,7 @@ Window { } ListView { - Component.onCompleted: { Accessible.id = "BubbleView" } + Accessible.id: "BubbleView" id: bubbleView // Close button overhang: half of 20px button height minus 2px visual offset // (see NotifyItemContent.qml closePlaceHolder topMargin: -height / 2 + 2) @@ -184,7 +184,7 @@ Window { delegate: BubbleDelegate { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "BubbleDelegate" } + Accessible.id: "BubbleDelegate" maxCount: model.bubbleCount onHeightChanged: { diff --git a/panels/notification/center/GroupNotify.qml b/panels/notification/center/GroupNotify.qml index cfd8c7b9b..d9edbe7ef 100644 --- a/panels/notification/center/GroupNotify.qml +++ b/panels/notification/center/GroupNotify.qml @@ -11,7 +11,7 @@ import org.deepin.ds.notificationcenter NotifyItem { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "NotifyItem" } + Accessible.id: "NotifyItem" id: root implicitWidth: impl.implicitWidth implicitHeight: impl.implicitHeight @@ -60,7 +60,7 @@ NotifyItem { contentItem: RowLayout { NotifyHeaderTitleText { Accessible.role: Accessible.StaticText - Component.onCompleted: { Accessible.id = "NotifyHeaderTitleText" } + Accessible.id: "NotifyHeaderTitleText" text: root.appName Layout.alignment: Qt.AlignLeft Layout.leftMargin: 18 @@ -74,7 +74,7 @@ NotifyItem { AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "Fold" } + Accessible.id: "Fold" id: foldBtn Layout.alignment: Qt.AlignRight activeFocusOnTab: false @@ -96,7 +96,7 @@ NotifyItem { } AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "More" } + Accessible.id: "More" id: groupMoreBtn Layout.alignment: Qt.AlignRight activeFocusOnTab: false @@ -119,7 +119,7 @@ NotifyItem { } AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "ClearAll" } + Accessible.id: "ClearAll" id: groupClearBtn Layout.alignment: Qt.AlignRight activeFocusOnTab: false diff --git a/panels/notification/center/NormalNotify.qml b/panels/notification/center/NormalNotify.qml index 36f89578b..a362ee8e6 100644 --- a/panels/notification/center/NormalNotify.qml +++ b/panels/notification/center/NormalNotify.qml @@ -11,7 +11,7 @@ import org.deepin.ds.notificationcenter NotifyItem { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "NotifyItem" } + Accessible.id: "NotifyItem" id: root implicitWidth: impl.implicitWidth implicitHeight: impl.implicitHeight @@ -55,7 +55,7 @@ NotifyItem { contentItem: NotifyItemContent { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "NotifyContent" } + Accessible.id: "NotifyContent" id: notifyContent width: parent.width appName: root.appName diff --git a/panels/notification/center/NotifyCenter.qml b/panels/notification/center/NotifyCenter.qml index 117401cce..59aaf0be8 100644 --- a/panels/notification/center/NotifyCenter.qml +++ b/panels/notification/center/NotifyCenter.qml @@ -47,7 +47,7 @@ FocusScope { anchors.fill: parent NotifyHeader { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "Header" } + Accessible.id: "Header" id: header anchors { top: parent.top @@ -75,7 +75,7 @@ FocusScope { NotifyView { Accessible.role: Accessible.List - Component.onCompleted: { Accessible.id = "View" } + Accessible.id: "View" id: view anchors { left: parent.left @@ -100,7 +100,7 @@ FocusScope { DropShadowText { Accessible.role: Accessible.StaticText - Component.onCompleted: { Accessible.id = "NoRecentNotifications" } + Accessible.id: "NoRecentNotifications" text: qsTr("No recent notifications") visible: root.stagingViewCount === 0 && view.viewCount === 0 anchors { diff --git a/panels/notification/center/NotifyHeader.qml b/panels/notification/center/NotifyHeader.qml index bc185edfe..2424592f8 100644 --- a/panels/notification/center/NotifyHeader.qml +++ b/panels/notification/center/NotifyHeader.qml @@ -73,7 +73,7 @@ FocusScope { NotifyHeaderTitleText { Accessible.role: Accessible.StaticText - Component.onCompleted: { Accessible.id = "NotificationCenter" } + Accessible.id: "NotificationCenter" id: titleText text: qsTr("Notification Center") elide: Text.ElideNone @@ -83,7 +83,7 @@ FocusScope { AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "Fold" } + Accessible.id: "Fold" id: collapseBtn objectName: "collapse" visible: !notifyModel.collapse @@ -108,7 +108,7 @@ FocusScope { AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "More" } + Accessible.id: "More" id: moreBtn objectName: "more" Layout.alignment: Qt.AlignRight @@ -138,7 +138,7 @@ FocusScope { NotifySettingMenu { id: headerSettingMenu MenuItem { - Component.onCompleted: { Accessible.id = "NotificationSetting" } + Accessible.id: "NotificationSetting" text: qsTr("Notification Setting") onClicked: { console.log("Notification setting") @@ -150,7 +150,7 @@ FocusScope { AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "ClearAll" } + Accessible.id: "ClearAll" id: clearAllBtn objectName: "closeAllNotify" activeFocusOnTab: false diff --git a/panels/notification/center/NotifyHeaderTitleText.qml b/panels/notification/center/NotifyHeaderTitleText.qml index 7fa965ede..fad949a58 100644 --- a/panels/notification/center/NotifyHeaderTitleText.qml +++ b/panels/notification/center/NotifyHeaderTitleText.qml @@ -10,7 +10,7 @@ import org.deepin.ds.notificationcenter DropShadowText { Accessible.role: Accessible.StaticText - Component.onCompleted: { Accessible.id = "DropShadowText" } + Accessible.id: "DropShadowText" property font tFont: DTK.fontManager.t4 color: DTK.themeType === ApplicationHelper.DarkType ? Qt.rgba(255, 255, 255, 0.7) : diff --git a/panels/notification/center/NotifySetting.qml b/panels/notification/center/NotifySetting.qml index ef72d643c..2679564d4 100644 --- a/panels/notification/center/NotifySetting.qml +++ b/panels/notification/center/NotifySetting.qml @@ -15,7 +15,7 @@ NotifySettingMenu { property string appName MenuItem { - Component.onCompleted: { Accessible.id = "Unpin" } + Accessible.id: "Unpin" text: pinned ? qsTr("Unpin") : qsTr("Pin") onClicked: { let state = !root.pinned @@ -24,7 +24,7 @@ NotifySettingMenu { } } MenuItem { - Component.onCompleted: { Accessible.id = "NotificationSetting" } + Accessible.id: "NotificationSetting" text: qsTr("Notification Setting") onClicked: { console.log("Notify setting") diff --git a/panels/notification/center/NotifyStaging.qml b/panels/notification/center/NotifyStaging.qml index affa3d673..1d480c601 100644 --- a/panels/notification/center/NotifyStaging.qml +++ b/panels/notification/center/NotifyStaging.qml @@ -80,7 +80,7 @@ FocusScope { } ListView { - Component.onCompleted: { Accessible.id = "View" } + Accessible.id: "View" id: view spacing: 10 snapMode: ListView.SnapToItem @@ -91,7 +91,7 @@ FocusScope { model: notifyModel delegate: OverlapNotify { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "OverlapNotify" } + Accessible.id: "OverlapNotify" id: overlapNotify objectName: "overlap-" + model.appName focus: true diff --git a/panels/notification/center/NotifyView.qml b/panels/notification/center/NotifyView.qml index 5e4751c0b..5cf0a9ab7 100644 --- a/panels/notification/center/NotifyView.qml +++ b/panels/notification/center/NotifyView.qml @@ -67,7 +67,7 @@ Control { activeFocusOnTab: false boundsBehavior: Flickable.StopAtBounds ScrollBar.vertical: ScrollBar { - Component.onCompleted: { Accessible.id = "Scrollbar" } + Accessible.id: "Scrollbar" } topMargin: 20 bottomMargin: 10 @@ -252,6 +252,6 @@ Control { background: BoundingRectangle { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "BoundingRectangle" } + Accessible.id: "BoundingRectangle" } } diff --git a/panels/notification/center/NotifyViewDelegate.qml b/panels/notification/center/NotifyViewDelegate.qml index a74277cdb..12e038bd4 100644 --- a/panels/notification/center/NotifyViewDelegate.qml +++ b/panels/notification/center/NotifyViewDelegate.qml @@ -57,7 +57,7 @@ DelegateChooser { roleValue: "group" GroupNotify { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "GroupNotify" } + Accessible.id: "GroupNotify" id: groupNotify objectName: "group-" + model.appName width: NotifyStyle.contentItem.width @@ -94,7 +94,7 @@ DelegateChooser { roleValue: "normal" NormalNotify { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "NormalNotify" } + Accessible.id: "NormalNotify" id: normalNotify objectName: "normal-" + model.appName width: NotifyStyle.contentItem.width @@ -168,7 +168,7 @@ DelegateChooser { roleValue: "overlap" OverlapNotify { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "OverlapNotify_2" } + Accessible.id: "OverlapNotify_2" id: overlapNotify objectName: "overlap-" + model.appName width: NotifyStyle.contentItem.width @@ -191,7 +191,7 @@ DelegateChooser { enableDismissed: false notifyContent.clearButton: AnimationSettingButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "CleanAll" } + Accessible.id: "CleanAll" id: clearBtn icon.name: "clean-alone" text: qsTr("Clean All") diff --git a/panels/notification/center/OverlapNotify.qml b/panels/notification/center/OverlapNotify.qml index 89e02e4b8..5c06edc2f 100644 --- a/panels/notification/center/OverlapNotify.qml +++ b/panels/notification/center/OverlapNotify.qml @@ -11,7 +11,7 @@ import org.deepin.ds.notificationcenter NotifyItem { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "NotifyItem" } + Accessible.id: "NotifyItem" id: root implicitWidth: impl.implicitWidth implicitHeight: impl.implicitHeight @@ -103,7 +103,7 @@ NotifyItem { implicitHeight: notifyContent.height + indicator.height NotifyItemContent { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "NotifyContent" } + Accessible.id: "NotifyContent" id: notifyContent width: parent.width appName: root.appName @@ -148,7 +148,7 @@ NotifyItem { OverlapIndicator { Accessible.role: Accessible.Indicator - Component.onCompleted: { Accessible.id = "Indicator" } + Accessible.id: "Indicator" id: indicator enableAnimation: (root.ListView.view && root.ListView.view.panelShown) ?? false clipItems: true diff --git a/panels/notification/center/package/main.qml b/panels/notification/center/package/main.qml index 0ee598a90..1750cd456 100644 --- a/panels/notification/center/package/main.qml +++ b/panels/notification/center/package/main.qml @@ -215,7 +215,7 @@ Window { NotifyStaging { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "NotifyStaging" } + Accessible.id: "NotifyStaging" id: notifyStaging anchors { top: parent.top @@ -243,7 +243,7 @@ Window { NotifyCenter { Accessible.role: Accessible.Pane - Component.onCompleted: { Accessible.id = "NotifyCenter" } + Accessible.id: "NotifyCenter" id: notifyCenter anchors { top: notifyStaging.bottom diff --git a/panels/notification/osd/displaymode/package/main.qml b/panels/notification/osd/displaymode/package/main.qml index 86ca1b26a..df1d933f9 100644 --- a/panels/notification/osd/displaymode/package/main.qml +++ b/panels/notification/osd/displaymode/package/main.qml @@ -41,7 +41,7 @@ AppletItem { } ListView { - Component.onCompleted: { Accessible.id = "View" } + Accessible.id: "View" id: view width: 350 height: contentHeight @@ -54,7 +54,7 @@ AppletItem { spacing: 10 delegate: D.ItemDelegate { - Component.onCompleted: { Accessible.id = "ItemView" } + Accessible.id: "ItemView" id: itemView height: 60 width: view.width diff --git a/panels/notification/osd/kblayout/package/main.qml b/panels/notification/osd/kblayout/package/main.qml index 47fe1c284..faf210549 100644 --- a/panels/notification/osd/kblayout/package/main.qml +++ b/panels/notification/osd/kblayout/package/main.qml @@ -33,7 +33,7 @@ AppletItem { } ListView { - Component.onCompleted: { Accessible.id = "View" } + Accessible.id: "View" id: view anchors { margins: 10 @@ -55,6 +55,7 @@ AppletItem { implicitWidth: maxItemWidth() delegate: D.ItemDelegate { + Accessible.id: "ItemView" id: itemView width: view.width height: 48 @@ -146,7 +147,6 @@ AppletItem { Qt.callLater(function () { view.implicitWidth = view.maxItemWidth() }) - Accessible.id = "ItemView" } } } diff --git a/panels/notification/osd/windoweffect/package/main.qml b/panels/notification/osd/windoweffect/package/main.qml index d99717723..ff2786fbc 100644 --- a/panels/notification/osd/windoweffect/package/main.qml +++ b/panels/notification/osd/windoweffect/package/main.qml @@ -72,7 +72,7 @@ AppletItem { } ListView { - Component.onCompleted: { Accessible.id = "Listview" } + Accessible.id: "Listview" id: listview width: 410 height: contentHeight @@ -84,7 +84,7 @@ AppletItem { spacing: 10 delegate: D.ItemDelegate { - Component.onCompleted: { Accessible.id = "ItemView" } + Accessible.id: "ItemView" id: itemView padding: 0 diff --git a/panels/notification/plugin/NotifyAction.qml b/panels/notification/plugin/NotifyAction.qml index 1ed92a9b6..1e532b9a1 100644 --- a/panels/notification/plugin/NotifyAction.qml +++ b/panels/notification/plugin/NotifyAction.qml @@ -180,7 +180,7 @@ Control { } component NotifyActionButton: Button { - Component.onCompleted: { Accessible.id = "ActionButton" } + Accessible.id: "ActionButton" id: actionButton required property var actionData property var actionMenu: null diff --git a/panels/notification/plugin/NotifyItemContent.qml b/panels/notification/plugin/NotifyItemContent.qml index ac0021b18..76c539488 100644 --- a/panels/notification/plugin/NotifyItemContent.qml +++ b/panels/notification/plugin/NotifyItemContent.qml @@ -11,7 +11,7 @@ import org.deepin.ds.notification NotifyItem { Accessible.role: Accessible.ListItem - Component.onCompleted: { Accessible.id = "NotifyItem" } + Accessible.id: "NotifyItem" id: root implicitWidth: impl.implicitWidth implicitHeight: impl.implicitHeight @@ -118,7 +118,7 @@ NotifyItem { active: !(root.strongInteractive && root.actions.length > 0) && (root.closeVisible || closePlaceHolder.hovered) sourceComponent: SettingActionButton { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "CloseBtn" } + Accessible.id: "CloseBtn" id: closeBtn objectName: "closeNotify-" + root.appName icon.name: "clean-alone" @@ -338,7 +338,7 @@ NotifyItem { Layout.topMargin: 8 sourceComponent: NotifyAction { Accessible.role: Accessible.Button - Component.onCompleted: { Accessible.id = "NotifyAction" } + Accessible.id: "NotifyAction" actions: root.actions onActionInvoked: function (actionId) { root.actionInvoked(actionId)