[vlc-commits] qml: define text entry in buttons to improve accessiblity
Pierre Lamot
git at videolan.org
Tue Nov 19 16:50:16 CET 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Nov 13 12:57:57 2019 +0100| [ad99518b68cfd5d1372903cc9fad833adb96274f] | committer: Jean-Baptiste Kempf
qml: define text entry in buttons to improve accessiblity
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad99518b68cfd5d1372903cc9fad833adb96274f
---
modules/gui/qt/qml/BannerSources.qml | 5 ++++
modules/gui/qt/qml/about/About.qml | 1 +
.../mediacenter/MusicAlbumsGridExpandDelegate.qml | 2 ++
.../qt/qml/mediacenter/VideoInfoExpandPanel.qml | 1 +
modules/gui/qt/qml/player/ControlButtons.qml | 30 ++++++++++++++++++++++
modules/gui/qt/qml/player/TeletextWidget.qml | 7 +++++
modules/gui/qt/qml/player/TopBar.qml | 2 ++
modules/gui/qt/qml/player/VolumeWidget.qml | 3 +++
modules/gui/qt/qml/utils/ListItem.qml | 3 +++
modules/gui/qt/qml/utils/SearchBox.qml | 1 +
modules/gui/qt/qml/utils/SortControl.qml | 1 +
11 files changed, 56 insertions(+)
diff --git a/modules/gui/qt/qml/BannerSources.qml b/modules/gui/qt/qml/BannerSources.qml
index 6244df6333..e94c9bcd6e 100644
--- a/modules/gui/qt/qml/BannerSources.qml
+++ b/modules/gui/qt/qml/BannerSources.qml
@@ -98,6 +98,7 @@ Utils.NavigableFocusScope {
id: history_back
size: VLCStyle.icon_normal
iconText: VLCIcons.topbar_previous
+ text: qsTr("Previous")
onClicked: history.previous(History.Go)
enabled: !history.previousEmpty
}
@@ -106,6 +107,7 @@ Utils.NavigableFocusScope {
id: history_next
size: VLCStyle.icon_normal
iconText: VLCIcons.topbar_next
+ text: qsTr("Next")
onClicked: history.next(History.Go)
enabled: !history.nextEmpty
}
@@ -162,6 +164,7 @@ Utils.NavigableFocusScope {
size: VLCStyle.icon_normal
iconText: VLCIcons.menu
+ text: qsTr("Menu")
onClicked: mainMenu.openBelow(this)
@@ -203,6 +206,7 @@ Utils.NavigableFocusScope {
id: list_grid_btn
size: VLCStyle.icon_normal
iconText: medialib.gridView ? VLCIcons.list : VLCIcons.grid
+ text: qsTr("List/Grid")
onClicked: medialib.gridView = !medialib.gridView
}
@@ -284,6 +288,7 @@ Utils.NavigableFocusScope {
size: VLCStyle.icon_normal
iconText: VLCIcons.playlist
+ text: qsTr("Playlist")
onClicked: rootWindow.playlistVisible = !rootWindow.playlistVisible
}
diff --git a/modules/gui/qt/qml/about/About.qml b/modules/gui/qt/qml/about/About.qml
index e7bb6e4377..8103cfdb51 100644
--- a/modules/gui/qt/qml/about/About.qml
+++ b/modules/gui/qt/qml/about/About.qml
@@ -94,6 +94,7 @@ Utils.NavigableFocusScope {
id: backBtn
size: VLCStyle.icon_large
iconText: VLCIcons.exit
+ text: qsTr("Back")
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
KeyNavigation.right: textScroll
diff --git a/modules/gui/qt/qml/mediacenter/MusicAlbumsGridExpandDelegate.qml b/modules/gui/qt/qml/mediacenter/MusicAlbumsGridExpandDelegate.qml
index cfa3a014b7..78dd90a352 100644
--- a/modules/gui/qt/qml/mediacenter/MusicAlbumsGridExpandDelegate.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicAlbumsGridExpandDelegate.qml
@@ -85,6 +85,7 @@ Utils.NavigableFocusScope {
Layout.alignment: Qt.AlignHCenter
iconText: VLCIcons.add
+ text: qsTr("Enqueue")
onClicked: medialib.addToPlaylist(model.id)
@@ -99,6 +100,7 @@ Utils.NavigableFocusScope {
size: VLCStyle.icon_normal
iconText: VLCIcons.play
+ text: qsTr("Play")
onClicked: medialib.addAndPlay(model.id)
diff --git a/modules/gui/qt/qml/mediacenter/VideoInfoExpandPanel.qml b/modules/gui/qt/qml/mediacenter/VideoInfoExpandPanel.qml
index 3cad9fcba7..3972cd52d3 100644
--- a/modules/gui/qt/qml/mediacenter/VideoInfoExpandPanel.qml
+++ b/modules/gui/qt/qml/mediacenter/VideoInfoExpandPanel.qml
@@ -260,6 +260,7 @@ Utils.NavigableFocusScope {
size: VLCStyle.icon_normal
iconText: VLCIcons.close
+ text: qsTr("Close")
color: VLCStyle.colors.lightText
focus: true
diff --git a/modules/gui/qt/qml/player/ControlButtons.qml b/modules/gui/qt/qml/player/ControlButtons.qml
index 352631bbef..d0acf5e5db 100644
--- a/modules/gui/qt/qml/player/ControlButtons.qml
+++ b/modules/gui/qt/qml/player/ControlButtons.qml
@@ -103,6 +103,7 @@ Item{
id: backBtn
size: VLCStyle.icon_medium
iconText: VLCIcons.exit
+ text: qsTr("Back")
onClicked: history.previous(History.Go)
property bool acceptFocus: true
}
@@ -117,6 +118,7 @@ Item{
iconText: VLCIcons.shuffle_on
onClicked: mainPlaylistController.toggleRandom()
property bool acceptFocus: true
+ text: qsTr("Random")
}
}
@@ -128,6 +130,7 @@ Item{
iconText: VLCIcons.previous
onClicked: mainPlaylistController.prev()
property bool acceptFocus: true
+ text: qsTr("Previous")
}
}
@@ -142,6 +145,10 @@ Item{
: VLCIcons.play
onClicked: mainPlaylistController.togglePlayPause()
property bool acceptFocus: true
+ text: (player.playingState !== PlayerController.PLAYING_STATE_PAUSED
+ && player.playingState !== PlayerController.PLAYING_STATE_STOPPED)
+ ? qsTr("Pause")
+ : qsTr("Play")
}
}
@@ -153,6 +160,7 @@ Item{
iconText: VLCIcons.next
onClicked: mainPlaylistController.next()
property bool acceptFocus: true
+ text: qsTr("Next")
}
}
@@ -167,6 +175,7 @@ Item{
visible: player.hasChapters
enabled: visible
property bool acceptFocus: visible
+ text: qsTr("Previous chapter")
}
}
@@ -182,6 +191,7 @@ Item{
visible: player.hasChapters
enabled: visible
property bool acceptFocus: visible
+ text: qsTr("Next chapter")
}
}
@@ -197,6 +207,7 @@ Item{
: VLCIcons.repeat_all
onClicked: mainPlaylistController.toggleRepeatMode()
property bool acceptFocus: true
+ text: qsTr("Repeat")
}
}
@@ -212,6 +223,8 @@ Item{
langMenu.open()
}
+ text: qsTr("Languages and tracks")
+
PlayerMenu {
id: langMenu
parent: rootPlayer
@@ -314,6 +327,7 @@ Item{
}
}
property bool acceptFocus: true
+ text: qsTr("Playlist")
}
}
@@ -337,6 +351,7 @@ Item{
}
}
property bool acceptFocus: true
+ text: qsTr("Menu")
}
}
@@ -405,6 +420,7 @@ Item{
iconText: rootWindow.interfaceFullScreen ?VLCIcons.defullscreen :VLCIcons.fullscreen
onClicked: rootWindow.interfaceFullScreen = !rootWindow.interfaceFullScreen
property bool acceptFocus: true
+ text: qsTr("fullscreen")
}
}
@@ -418,6 +434,7 @@ Item{
checked: player.isRecording
onClicked: player.toggleRecord()
property bool acceptFocus: true
+ text: qsTr("record")
}
}
@@ -441,6 +458,7 @@ Item{
color: VLCStyle.colors.buttonText
colorOverlay: VLCStyle.colors.banner
property bool acceptFocus: true
+ text: qsTr("A to B")
}
}
@@ -453,6 +471,7 @@ Item{
iconText: VLCIcons.snapshot
onClicked: player.snapshot()
property bool acceptFocus: true
+ text: qsTr("Snapshot")
}
}
@@ -466,6 +485,7 @@ Item{
iconText: VLCIcons.stop
onClicked: mainPlaylistController.stop()
property bool acceptFocus: true
+ text: qsTr("Stop")
}
}
@@ -478,6 +498,7 @@ Item{
iconText: VLCIcons.info
onClicked: dialogProvider.mediaInfoDialog()
property bool acceptFocus: true
+ text: qsTr("Informations")
}
}
@@ -491,6 +512,7 @@ Item{
iconText: VLCIcons.frame_by_frame
onClicked: player.frameNext()
property bool acceptFocus: true
+ text: qsTr("Next frame")
}
}
@@ -503,6 +525,7 @@ Item{
iconText: VLCIcons.faster
onClicked: player.faster()
property bool acceptFocus: true
+ text: qsTr("Faster")
}
}
@@ -515,6 +538,7 @@ Item{
iconText: VLCIcons.slower
onClicked: player.slower()
property bool acceptFocus: true
+ text: qsTr("Slower")
}
}
@@ -526,6 +550,7 @@ Item{
iconText: VLCIcons.eject
onClicked: dialogProvider.openDialog()
property bool acceptFocus: true
+ text: qsTr("Open media")
}
}
@@ -537,6 +562,7 @@ Item{
text: VLCIcons.extended
onClicked: dialogProvider.extendedDialog()
property bool acceptFocus: true
+ Accessible.name: qsTr("Extended settings")
}
}
@@ -548,6 +574,7 @@ Item{
iconText: VLCIcons.skip_for
onClicked: player.jumpFwd()
property bool acceptFocus: true
+ text: qsTr("Step forward")
}
}
@@ -559,6 +586,7 @@ Item{
iconText: VLCIcons.skip_back
onClicked: player.jumpBwd()
property bool acceptFocus: true
+ text: qsTr("Step back")
}
}
@@ -570,6 +598,7 @@ Item{
iconText: VLCIcons.clear
onClicked: rootWindow.close()
property bool acceptFocus: true
+ text: qsTr("Quit")
}
}
@@ -586,6 +615,7 @@ Item{
currentIndex: -1
onCurrentIndexChanged: model.toggleIndex(currentIndex)
property bool acceptFocus: true
+ Accessible.name: qsTr("Aspect ratio")
}
}
diff --git a/modules/gui/qt/qml/player/TeletextWidget.qml b/modules/gui/qt/qml/player/TeletextWidget.qml
index 62f6efaa55..f69a0bb055 100644
--- a/modules/gui/qt/qml/player/TeletextWidget.qml
+++ b/modules/gui/qt/qml/player/TeletextWidget.qml
@@ -50,6 +50,7 @@ FocusScope{
id: teleActivateBtn
paintOnly: widgetfscope.paintOnly
iconText: VLCIcons.tv
+ text: qsTr("Teletext activate")
size: VLCStyle.icon_normal
onClicked: player.teletextEnabled = !player.teletextEnabled
color: widgetfscope.color
@@ -63,6 +64,7 @@ FocusScope{
id: teleTransparencyBtn
paintOnly: widgetfscope.paintOnly
iconText: VLCIcons.tvtelx
+ text: qsTr("Teletext transparency")
size: VLCStyle.icon_normal
opacity: 0.5
enabled: player.teletextEnabled
@@ -89,6 +91,7 @@ FocusScope{
enabled: player.teletextEnabled
size: VLCStyle.icon_normal
iconText: VLCIcons.record
+ text: qsTr("Index key")
onClicked: player.teletextPage = PlayerController.TELE_INDEX
color: "grey"
colorDisabled: "grey"
@@ -100,6 +103,7 @@ FocusScope{
enabled: player.teletextEnabled
size: VLCStyle.icon_normal
iconText: VLCIcons.record
+ text: qsTr("Red key")
onClicked: player.teletextPage = PlayerController.TELE_RED
color: "red"
colorDisabled: "grey"
@@ -111,6 +115,7 @@ FocusScope{
enabled: player.teletextEnabled
size: VLCStyle.icon_normal
iconText: VLCIcons.record
+ text: qsTr("Green key")
onClicked: player.teletextPage = PlayerController.TELE_GREEN
color: "green"
colorDisabled: "grey"
@@ -122,6 +127,7 @@ FocusScope{
enabled: player.teletextEnabled
size: VLCStyle.icon_normal
iconText: VLCIcons.record
+ text: qsTr("Yellow key")
onClicked: player.teletextPage = PlayerController.TELE_YELLOW
color: "yellow"
colorDisabled: "grey"
@@ -133,6 +139,7 @@ FocusScope{
enabled: player.teletextEnabled
size: VLCStyle.icon_normal
iconText: VLCIcons.record
+ text: qsTr("Blue key")
onClicked: player.teletextPage = PlayerController.TELE_BLUE
color: "blue"
colorDisabled: "grey"
diff --git a/modules/gui/qt/qml/player/TopBar.qml b/modules/gui/qt/qml/player/TopBar.qml
index 7606b4c65d..57357348de 100644
--- a/modules/gui/qt/qml/player/TopBar.qml
+++ b/modules/gui/qt/qml/player/TopBar.qml
@@ -69,6 +69,7 @@ Utils.NavigableFocusScope{
objectName: "IconToolButton"
size: VLCStyle.icon_normal
iconText: VLCIcons.exit
+ text: qsTr("Back")
color: VLCStyle.colors.playerFg
onClicked: {
if (player.playingState === PlayerController.PLAYING_STATE_PAUSED) {
@@ -89,6 +90,7 @@ Utils.NavigableFocusScope{
objectName: PlayerControlBarModel.PLAYLIST_BUTTON
size: VLCStyle.icon_normal
iconText: VLCIcons.playlist
+ text: qsTr("Playlist")
color: VLCStyle.colors.playerFg
onClicked: togglePlaylistVisiblity()
property bool acceptFocus: true
diff --git a/modules/gui/qt/qml/player/VolumeWidget.qml b/modules/gui/qt/qml/player/VolumeWidget.qml
index f1fcb0d2f6..e88bbc1310 100644
--- a/modules/gui/qt/qml/player/VolumeWidget.qml
+++ b/modules/gui/qt/qml/player/VolumeWidget.qml
@@ -53,6 +53,7 @@ FocusScope{
VLCIcons.volume_medium
else
VLCIcons.volume_high
+ text: qsTr("Mute")
color: widgetfscope.color
onClicked: player.muted = !player.muted
KeyNavigation.right: volControl
@@ -72,6 +73,8 @@ FocusScope{
opacity: player.muted ? 0.5 : 1
focus: true
+ Accessible.name: qsTr("Volume")
+
Keys.onReleased: {
if (event.accepted)
return;
diff --git a/modules/gui/qt/qml/utils/ListItem.qml b/modules/gui/qt/qml/utils/ListItem.qml
index a43ab62c87..2c3aae487e 100644
--- a/modules/gui/qt/qml/utils/ListItem.qml
+++ b/modules/gui/qt/qml/utils/ListItem.qml
@@ -49,6 +49,7 @@ NavigableFocusScope {
IconToolButton {
size: VLCStyle.icon_normal
iconText: VLCIcons.add
+ text: qsTr("Enqueue")
focus: true
@@ -70,6 +71,7 @@ NavigableFocusScope {
size: VLCStyle.icon_normal
//visible: mouse.containsMouse || root.activeFocus
iconText: VLCIcons.play
+ text: qsTr("Play")
focus: true
@@ -196,6 +198,7 @@ NavigableFocusScope {
id: contextButton
size: VLCStyle.icon_normal
iconText: VLCIcons.ellipsis
+ text: qsTr("More")
visible: root.showContextButton
focus: actionButtons.length == toolButtons.focusIndex
diff --git a/modules/gui/qt/qml/utils/SearchBox.qml b/modules/gui/qt/qml/utils/SearchBox.qml
index 82115ebdbb..4c15297526 100644
--- a/modules/gui/qt/qml/utils/SearchBox.qml
+++ b/modules/gui/qt/qml/utils/SearchBox.qml
@@ -98,6 +98,7 @@ Utils.NavigableFocusScope {
size: VLCStyle.icon_normal
iconText: VLCIcons.topbar_filter
+ text: qsTr("Filter")
focus: true
diff --git a/modules/gui/qt/qml/utils/SortControl.qml b/modules/gui/qt/qml/utils/SortControl.qml
index af151d57b3..fee13bfd15 100644
--- a/modules/gui/qt/qml/utils/SortControl.qml
+++ b/modules/gui/qt/qml/utils/SortControl.qml
@@ -53,6 +53,7 @@ Utils.NavigableFocusScope {
size: VLCStyle.icon_normal
iconText: VLCIcons.topbar_sort
+ text: qsTr("Sort")
focus: true
More information about the vlc-commits
mailing list