Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions panels/dock/OverflowContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Item {
layoutDirection: Qt.LeftToRight
verticalLayoutDirection: ListView.TopToBottom
interactive: false
Accessible.role: Accessible.List
}

function calculateImplicitWidth(prev, current) {
Expand Down
3 changes: 3 additions & 0 deletions panels/dock/multitaskview/package/multitaskview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ AppletDockItem {
id: toggleworkspace
dockOrder: 15

Accessible.role: Accessible.Button
Accessible.name: toolTip.text

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个应该使用dock插件的名称,例如App let.name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

核实过,这个建议在当前代码结构下不可行:

Applet 在该上下文中指向当前插件的 DApplet 实例(frame/appletitem.cpp:36-43 通过 _ds_applet 上下文取回),QML 侧可访问的属性只有 id / pluginId / parent / rootObject(frame/applet.h:24-27),并没有 name 属性;同时 dock 各插件的 metadata.json 也没有 "Name" 字段(multitaskview 的 metadata 只有 Id/Url/Parent),即没有可绑定的数据来源。直接写 Applet.name 会绑定到 undefined,无障碍名称反而会丢失。

toolTip.text 本身就是该插件 UI 里现有的人类可读名称(已带翻译),绑到它可以保证单一来源、不产生文案分歧。如果希望统一从插件元数据取名,需要先给 metadata 增加 "Name" 字段、并在 DApplet 上暴露 name 属性——这属于框架层改动,建议另开 PR 处理,本 PR 保持纯标注范围。


PanelToolTip {
id: toolTip
text: qsTr("Multitasking View")
Expand Down
6 changes: 6 additions & 0 deletions panels/dock/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ Window {
visible: dockLeftPartModel.count > 0
implicitWidth: leftLoader.implicitWidth
implicitHeight: leftLoader.implicitHeight
Accessible.role: Accessible.Grouping
Accessible.name: qsTr("Dock Left Area")
OverflowContainer {
id: leftLoader
anchors.fill: parent
Expand All @@ -536,6 +538,8 @@ Window {
id: dockCenterPart
implicitWidth: centerLoader.implicitWidth
implicitHeight: centerLoader.implicitHeight
Accessible.role: Accessible.Grouping
Accessible.name: qsTr("Dock Center Area")
Layout.maximumWidth: useColumnLayout ? -1 : dockRawCenterSpace
Layout.maximumHeight: useColumnLayout ? dockRawCenterSpace : -1
onXChanged: dockCenterPartPosChanged()
Expand Down Expand Up @@ -584,6 +588,8 @@ Window {
id: dockRightPart
implicitWidth: rightLoader.implicitWidth
implicitHeight: rightLoader.implicitHeight
Accessible.role: Accessible.Grouping
Accessible.name: qsTr("Dock Right Area")
anchors.right: parent.right
anchors.bottom: parent.bottom
OverflowContainer {
Expand Down
5 changes: 4 additions & 1 deletion panels/dock/showdesktop/package/showdesktop.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -30,6 +30,9 @@ AppletItem {
anchors.fill: parent
radius: 0

Accessible.role: Accessible.Button
Accessible.name: toolTip.text

Rectangle {
property D.Palette lineColor: DockPalette.showDesktopLineColor
// Use device pixel ratio to ensure the line is always 1 physical pixel regardless of system scaling
Expand Down
4 changes: 4 additions & 0 deletions panels/dock/taskmanager/package/AppItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Item {
Drag.hotSpot.y: icon.height / 2
Drag.dragType: Drag.Automatic
Drag.mimeData: { "text/x-dde-dock-dnd-appid": itemId, "text/x-dde-dock-dnd-source": "taskbar", "text/x-dde-dock-dnd-winid": windows.length > 0 ? windows[0] : ""}

Accessible.role: Accessible.Button
Accessible.name: root.name
Accessible.description: root.attention ? qsTr("Demands attention") : (root.active ? qsTr("Active") : "")

property bool useColumnLayout: Panel.rootObject.useColumnLayout
property real iconSize: Panel.rootObject.dockItemMaxSize * 9 / 14
Expand Down
3 changes: 3 additions & 0 deletions panels/dock/taskmanager/package/TaskManager.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ContainmentItem {
property bool useColumnLayout: Panel.rootObject.useColumnLayout
property int dockOrder: 16

Accessible.role: Accessible.Grouping
Accessible.name: qsTr("Task Manager")

function calcRemainingSpace(baseSize) {
const otherCount = Panel.rootObject.dockCenterPartCount - 1;
const otherOccupied = otherCount > 0 ? otherCount * baseSize * multitaskViewIconRatio : 0;
Expand Down
2 changes: 2 additions & 0 deletions panels/dock/tray/ShellSurfaceItemProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Item {
implicitWidth: shellSurface ? shellSurface.width : 16
implicitHeight: shellSurface ? shellSurface.height : 16

Accessible.name: shellSurface ? (shellSurface.displayName || "") : ""

function takeFocus() {
impl.takeFocus()
}
Expand Down
3 changes: 3 additions & 0 deletions panels/dock/tray/package/ActionShowStashDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ AppletItemButton {

padding: itemPadding

Accessible.role: Accessible.Button
Accessible.name: toolTip.text

D.ColorSelector.hovered: (isDropHover && DDT.TraySortOrderModel.actionsAlwaysVisible) || hovered || stashedPopup.popupVisible

property var itemGlobalPoint: {
Expand Down
5 changes: 4 additions & 1 deletion panels/dock/tray/package/ActionToggleCollapseDelegate.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -17,6 +17,9 @@ AppletItemButton {
hoverEnabled: inputEventsEnabled
autoClosePopup: true

Accessible.role: Accessible.Button
Accessible.name: toolTip.text

z: 5

icon.name: isHorizontal ? "expand-left" : "expand-up"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024-2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -13,4 +13,7 @@ QuickPanel {
useColumnLayout: !isHorizontal
trayItemPluginId: Applet.rootObject.quickpanelTrayItemPluginId
trayItemMargins: itemPadding

Accessible.role: Accessible.Button
Accessible.name: qsTr("Quick actions")
}
Loading