[gtk: 1/2] Fix some accessibility issues in demos
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 1/2] Fix some accessibility issues in demos
- Date: Tue, 20 Mar 2018 15:34:53 +0000 (UTC)
commit 9561b97dc4d2b9626e2735da6a993dfe4e01def0
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date: Mon Mar 19 16:29:25 2018 +0100
Fix some accessibility issues in demos
Fixes #110
demos/gtk-demo/filtermodel.ui | 18 +++++++++++++++++
demos/gtk-demo/scale.ui | 30 ++++++++++++++++++++++------
demos/gtk-demo/theming.ui | 1 +
demos/icon-browser/window.ui | 36 ++++++++++++++++++++++++++++++++++
demos/widget-factory/widget-factory.ui | 19 +++++++++++++++---
5 files changed, 95 insertions(+), 9 deletions(-)
---
diff --git a/demos/gtk-demo/filtermodel.ui b/demos/gtk-demo/filtermodel.ui
index 8d7d3acf29..585ad696cc 100644
--- a/demos/gtk-demo/filtermodel.ui
+++ b/demos/gtk-demo/filtermodel.ui
@@ -45,6 +45,9 @@
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
+ <accessibility>
+ <relation type="label-for" target="treeview1"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -81,6 +84,9 @@
</child>
</object>
</child>
+ <accessibility>
+ <relation type="labelled-by" target="label1"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -129,6 +135,9 @@
</child>
</object>
</child>
+ <accessibility>
+ <relation type="labelled-by" target="label2"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
@@ -142,6 +151,9 @@
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
+ <accessibility>
+ <relation type="label-for" target="treeview2"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
@@ -155,6 +167,9 @@
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
+ <accessibility>
+ <relation type="label-for" target="treeview3"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -185,6 +200,9 @@
</child>
</object>
</child>
+ <accessibility>
+ <relation type="labelled-by" target="label3"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
diff --git a/demos/gtk-demo/scale.ui b/demos/gtk-demo/scale.ui
index 7d4329d669..7654044186 100644
--- a/demos/gtk-demo/scale.ui
+++ b/demos/gtk-demo/scale.ui
@@ -27,9 +27,12 @@
<property name="column-spacing">10</property>
<property name="margin">20</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="label_plain">
<property name="label">Plain</property>
<property name="xalign">0</property>
+ <accessibility>
+ <relation type="label-for" target="scale_plain"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -37,12 +40,15 @@
</packing>
</child>
<child>
- <object class="GtkScale">
+ <object class="GtkScale" id="scale_plain">
<property name="can-focus">1</property>
<property name="width-request">200</property>
<property name="draw-value">0</property>
<property name="adjustment">adjustment1</property>
<property name="hexpand">1</property>
+ <accessibility>
+ <relation type="labelled-by" target="label_plain"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
@@ -50,9 +56,12 @@
</packing>
</child>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="label_marks">
<property name="label">Marks</property>
<property name="xalign">0</property>
+ <accessibility>
+ <relation type="label-for" target="scale_marks"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -60,7 +69,7 @@
</packing>
</child>
<child>
- <object class="GtkScale">
+ <object class="GtkScale" id="scale_marks">
<property name="can-focus">1</property>
<property name="width-request">200</property>
<property name="draw-value">0</property>
@@ -73,6 +82,9 @@
<mark value="3" position="bottom"></mark>
<mark value="4" position="bottom"></mark>
</marks>
+ <accessibility>
+ <relation type="labelled-by" target="label_marks"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
@@ -80,9 +92,12 @@
</packing>
</child>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="label_discrete">
<property name="label">Discrete</property>
<property name="xalign">0</property>
+ <accessibility>
+ <relation type="label-for" target="scale_discrete"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -90,13 +105,16 @@
</packing>
</child>
<child>
- <object class="GtkScale">
+ <object class="GtkScale" id="scale_discrete">
<property name="can-focus">1</property>
<property name="width-request">200</property>
<property name="round-digits">0</property>
<property name="draw-value">0</property>
<property name="adjustment">adjustment3</property>
<property name="hexpand">1</property>
+ <accessibility>
+ <relation type="labelled-by" target="label_discrete"/>
+ </accessibility>
<marks>
<mark value="0" position="bottom"></mark>
<mark value="1" position="bottom"></mark>
diff --git a/demos/gtk-demo/theming.ui b/demos/gtk-demo/theming.ui
index 864a29faf0..59cd956eca 100644
--- a/demos/gtk-demo/theming.ui
+++ b/demos/gtk-demo/theming.ui
@@ -104,6 +104,7 @@
<child>
<object class="GtkSwitch" id="switch1">
<property name="can-focus">1</property>
+ <property name="tooltip_text">Switch it</property>
</object>
</child>
</object>
diff --git a/demos/icon-browser/window.ui b/demos/icon-browser/window.ui
index 8692295bdf..c56dcbaa6c 100644
--- a/demos/icon-browser/window.ui
+++ b/demos/icon-browser/window.ui
@@ -133,6 +133,9 @@
<object class="GtkImage" id="image1">
<property name="halign">center</property>
<property name="valign">end</property>
+ <accessibility>
+ <relation type="labelled-by" target="label1"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -143,6 +146,9 @@
<object class="GtkImage" id="image2">
<property name="halign">center</property>
<property name="valign">end</property>
+ <accessibility>
+ <relation type="labelled-by" target="label2"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
@@ -153,6 +159,9 @@
<object class="GtkImage" id="image3">
<property name="halign">center</property>
<property name="valign">end</property>
+ <accessibility>
+ <relation type="labelled-by" target="label3"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">2</property>
@@ -163,6 +172,9 @@
<object class="GtkImage" id="image4">
<property name="halign">center</property>
<property name="valign">end</property>
+ <accessibility>
+ <relation type="labelled-by" target="label4"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">3</property>
@@ -173,6 +185,9 @@
<object class="GtkImage" id="image5">
<property name="halign">center</property>
<property name="valign">end</property>
+ <accessibility>
+ <relation type="labelled-by" target="label5"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">4</property>
@@ -183,6 +198,9 @@
<object class="GtkImage" id="image6">
<property name="halign">center</property>
<property name="valign">end</property>
+ <accessibility>
+ <relation type="labelled-by" target="label6"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">5</property>
@@ -197,6 +215,9 @@
<style>
<class name="dim-label"/>
</style>
+ <accessibility>
+ <relation type="label-for" target="image1"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -211,6 +232,9 @@
<style>
<class name="dim-label"/>
</style>
+ <accessibility>
+ <relation type="label-for" target="image2"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
@@ -225,6 +249,9 @@
<style>
<class name="dim-label"/>
</style>
+ <accessibility>
+ <relation type="label-for" target="image3"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">2</property>
@@ -239,6 +266,9 @@
<style>
<class name="dim-label"/>
</style>
+ <accessibility>
+ <relation type="label-for" target="image4"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">3</property>
@@ -253,6 +283,9 @@
<style>
<class name="dim-label"/>
</style>
+ <accessibility>
+ <relation type="label-for" target="image5"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">4</property>
@@ -267,6 +300,9 @@
<style>
<class name="dim-label"/>
</style>
+ <accessibility>
+ <relation type="label-for" target="image6"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">5</property>
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 8474d08d76..585bb3db5b 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -3464,9 +3464,12 @@ bad things might happen.</property>
<property name="row-spacing">10</property>
<property name="column-spacing">10</property>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="title_label">
<property name="label">Title:</property>
<property name="xalign">1</property>
+ <accessibility>
+ <relation type="label-for" target="open_popover_entry"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -3474,10 +3477,13 @@ bad things might happen.</property>
</packing>
</child>
<child>
- <object class="GtkLabel">
+ <object class="GtkLabel" id="description_label">
<property name="valign">start</property>
<property name="label">Description:</property>
<property name="xalign">1</property>
+ <accessibility>
+ <relation type="label-for" target="open_popover_textview"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">0</property>
@@ -3493,7 +3499,11 @@ bad things might happen.</property>
<property name="min-content-width">100</property>
<property name="max-content-width">100</property>
<child>
- <object class="GtkTextView" id="open_popover_textview"/>
+ <object class="GtkTextView" id="open_popover_textview">
+ <accessibility>
+ <relation type="labelled-by" target="description_label"/>
+ </accessibility>
+ </object>
</child>
</object>
<packing>
@@ -3504,6 +3514,9 @@ bad things might happen.</property>
<child>
<object class="GtkEntry" id="open_popover_entry">
<property name="activates-default">1</property>
+ <accessibility>
+ <relation type="labelled-by" target="title_label"/>
+ </accessibility>
</object>
<packing>
<property name="left-attach">1</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]