[vlc-devel] [PATCH 3/3] qml: improve accessibility of list and grid views

Pierre Lamot pierre at videolabs.io
Mon Nov 18 18:17:35 CET 2019


---
 modules/gui/qt/qml/utils/ExpandGridView.qml        | 2 ++
 modules/gui/qt/qml/utils/GridItem.qml              | 3 +++
 modules/gui/qt/qml/utils/IconToolButton.qml        | 6 ++++++
 modules/gui/qt/qml/utils/KeyNavigableGridView.qml  | 2 ++
 modules/gui/qt/qml/utils/KeyNavigableListView.qml  | 2 ++
 modules/gui/qt/qml/utils/KeyNavigableTableView.qml | 2 ++
 modules/gui/qt/qml/utils/ListItem.qml              | 3 +++
 modules/gui/qt/qml/utils/VideoProgressBar.qml      | 1 +
 modules/gui/qt/qml/utils/VideoQualityLabel.qml     | 1 +
 9 files changed, 22 insertions(+)

diff --git a/modules/gui/qt/qml/utils/ExpandGridView.qml b/modules/gui/qt/qml/utils/ExpandGridView.qml
index eb2d0c4f2c..2bfa6c91db 100644
--- a/modules/gui/qt/qml/utils/ExpandGridView.qml
+++ b/modules/gui/qt/qml/utils/ExpandGridView.qml
@@ -59,6 +59,8 @@ NavigableFocusScope {
 
     property double _expandRetractSpeed: 1.
 
+    Accessible.role: Accessible.Table
+
     function renderLayout() {
         flickable.layout()
     }
diff --git a/modules/gui/qt/qml/utils/GridItem.qml b/modules/gui/qt/qml/utils/GridItem.qml
index dbf6d59eba..1975bc4924 100644
--- a/modules/gui/qt/qml/utils/GridItem.qml
+++ b/modules/gui/qt/qml/utils/GridItem.qml
@@ -58,6 +58,9 @@ Rectangle {
 
     Keys.onMenuPressed: root.contextMenuButtonClicked(cover_bg)
 
+    Accessible.role: Accessible.Cell
+    Accessible.name: title
+
     Item {
         id: gridItem
         width: childrenRect.width
diff --git a/modules/gui/qt/qml/utils/IconToolButton.qml b/modules/gui/qt/qml/utils/IconToolButton.qml
index ed319196b5..14fa2e9180 100644
--- a/modules/gui/qt/qml/utils/IconToolButton.qml
+++ b/modules/gui/qt/qml/utils/IconToolButton.qml
@@ -61,6 +61,8 @@ ToolButton {
             verticalAlignment: Text.AlignVCenter
             horizontalAlignment: Text.AlignHCenter
 
+            Accessible.ignored: true
+
             Label {
                 text: control.textOverlay
                 color: control.colorOverlay
@@ -73,6 +75,8 @@ ToolButton {
                 verticalAlignment: Text.AlignVCenter
                 horizontalAlignment: Text.AlignHCenter
 
+                Accessible.ignored: true
+
             }
 
             Label {
@@ -87,6 +91,8 @@ ToolButton {
 
                 verticalAlignment: Text.AlignVCenter
                 horizontalAlignment: Text.AlignHCenter
+
+                Accessible.ignored: true
             }
 
         }
diff --git a/modules/gui/qt/qml/utils/KeyNavigableGridView.qml b/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
index 1eddabda6e..d6ed7561eb 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
@@ -51,6 +51,8 @@ NavigableFocusScope {
 
     property alias currentIndex: view.currentIndex
 
+    Accessible.role: Accessible.Table
+
     GridView {
         id: view
 
diff --git a/modules/gui/qt/qml/utils/KeyNavigableListView.qml b/modules/gui/qt/qml/utils/KeyNavigableListView.qml
index fdc1ea57ba..995260747d 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableListView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableListView.qml
@@ -58,6 +58,8 @@ NavigableFocusScope {
     property alias section: view.section
     property alias orientation: view.orientation
 
+    Accessible.role: Accessible.List
+
     function nextPage() {
         view.contentX += (Math.min(view.width, (view.contentWidth - view.width - view.contentX ) ))
     }
diff --git a/modules/gui/qt/qml/utils/KeyNavigableTableView.qml b/modules/gui/qt/qml/utils/KeyNavigableTableView.qml
index 9270f2d622..a52ae49961 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableTableView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableTableView.qml
@@ -52,6 +52,8 @@ NavigableFocusScope {
     property real rowHeight: VLCStyle.fontHeight_normal + VLCStyle.margin_large
     property alias spacing: view.spacing
 
+    Accessible.role: Accessible.Table
+
     Utils.SelectableDelegateModel {
         id: delegateModel
 
diff --git a/modules/gui/qt/qml/utils/ListItem.qml b/modules/gui/qt/qml/utils/ListItem.qml
index 2c3aae487e..0caf351db4 100644
--- a/modules/gui/qt/qml/utils/ListItem.qml
+++ b/modules/gui/qt/qml/utils/ListItem.qml
@@ -44,6 +44,9 @@ NavigableFocusScope {
 
     Keys.onMenuPressed: root.contextMenuButtonClicked(cover_bg)
 
+    Accessible.role: Accessible.ListItem
+    Accessible.name: line1
+
     Component {
         id: actionAdd
         IconToolButton {
diff --git a/modules/gui/qt/qml/utils/VideoProgressBar.qml b/modules/gui/qt/qml/utils/VideoProgressBar.qml
index f554ec21e3..464f2092e0 100644
--- a/modules/gui/qt/qml/utils/VideoProgressBar.qml
+++ b/modules/gui/qt/qml/utils/VideoProgressBar.qml
@@ -33,4 +33,5 @@ ProgressBar {
             color: VLCStyle.colors.accent
         }
     }
+    Accessible.ignored: true
 }
diff --git a/modules/gui/qt/qml/utils/VideoQualityLabel.qml b/modules/gui/qt/qml/utils/VideoQualityLabel.qml
index 7ae151e13a..a312d9124e 100644
--- a/modules/gui/qt/qml/utils/VideoQualityLabel.qml
+++ b/modules/gui/qt/qml/utils/VideoQualityLabel.qml
@@ -34,4 +34,5 @@ Label {
         opacity: 0.5
         radius: 3
     }
+    Accessible.ignored: true
 }
-- 
2.17.1



More information about the vlc-devel mailing list