Merge ~nteodosio/software-properties:attach-url into software-properties:ubuntu/master

Proposed by Nathan Teodosio
Status: Needs review
Proposed branch: ~nteodosio/software-properties:attach-url
Merge into: software-properties:ubuntu/master
Diff against target: 94 lines (+55/-19)
1 file modified
data/gtkbuilder/dialog-ua-attach.ui (+55/-19)
Reviewer Review Type Date Requested Status
Sebastien Bacher Needs Information
Oliver Smith Pending
Elio Qoshi screen reader Pending
Dimitri John Ledkov Pending
Review via email: mp+454886@code.launchpad.net

Description of the change

Currently if you go to the "Enable Ubuntu Pro" dialog of software-properties-gtk, there is a mention to ubuntu.com/pro/attach, but that mention is not an hyperlink due to limitations in the label of a radio button in GTK. Just setting markup on the child label of the GtkRadioButton is not enough; The URI would nonetheless be not clickable because the radio button activation action takes precedence.

The here proposed change could in principle confuse users of screen readers, because it removes the child label of the radio buttons and instead separates them as independent widgets. But as such, it also includes accessibility directives to fix that.

I'd like to kindly request someone from the User Interface team to review that the screen reader reads that dialog correctly. For what it's worth, I tested this on my side and it seems fine.

This merge request is an alternative to https://code.launchpad.net/~xnox/software-properties/+git/software-properties/+merge/443188.

To test without building and installing package: Clone the repository, cd into it, run ./software-properties-gtk --data-dir=$PWD/data, make sure screen reader is on[1].

[1] https://help.ubuntu.com/stable/ubuntu-help/a11y-screen-reader.html.en

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Nathan. The issue with the change suggested by Dimitri here (and the reason GTK isn't providing the option to have an activable URL) is that with the change you need to click on the small circle to change the selection (instead of being able to click anywhere on the line include the text description of the options).

I would like to have input of design and/or Oliver on the right tradeoff. Another option would be to slightly change the design to have the URL as a subtitle/other line and not part of the label...

review: Needs Information
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

For visual reference for Oliver: I posted an image of that in https://chat.canonical.com/canonical/pl/g5iwf5muqbg3z87hq8hmay56yc

Unmerged commits

4702484... by Nathan Teodosio

Accessibility: Help screen reader to read radio buttons.

6bd13d0... by Nathan Teodosio

Make ubuntu.com URL apparent and clickable.

Just setting markup on the child label of the GtkRadioButton is not enough;
The URI would nonetheless be not clickable because the radio button activation
action takes precedence.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/data/gtkbuilder/dialog-ua-attach.ui b/data/gtkbuilder/dialog-ua-attach.ui
2index 1445b82..f8c3fad 100644
3--- a/data/gtkbuilder/dialog-ua-attach.ui
4+++ b/data/gtkbuilder/dialog-ua-attach.ui
5@@ -30,18 +30,36 @@
6 <object class="GtkBox" id="radio_net_control_box">
7 <property name="visible">True</property>
8 <property name="orientation">vertical</property>
9- <child>
10- <object class="GtkRadioButton" id="magic_radio">
11- <property name="label" translatable="yes">Enter code on ubuntu.com/pro/attach</property>
12- <property name="visible">True</property>
13- <property name="can-focus">True</property>
14- <property name="receives-default">False</property>
15- <property name="margin-top">30</property>
16- <property name="xalign">0</property>
17- <property name="group">magic_radio</property>
18- <signal name="clicked" handler="on_magic_radio_clicked" swapped="no"/>
19- </object>
20- </child>
21+ <child>
22+ <object class="GtkBox">
23+ <property name="visible">True</property>
24+ <property name="orientation">horizontal</property>
25+ <property name="spacing">4</property>
26+ <property name="margin-top">30</property>
27+ <child>
28+ <object class="GtkRadioButton" id="magic_radio">
29+ <property name="visible">True</property>
30+ <property name="can-focus">True</property>
31+ <property name="receives-default">False</property>
32+ <property name="xalign">0</property>
33+ <property name="group">magic_radio</property>
34+ <signal name="clicked" handler="on_magic_radio_clicked" swapped="no"/>
35+ <child internal-child="accessible">
36+ <object class="AtkObject">
37+ <property name="AtkObject::accessible-name" translatable="yes">Enter code on ubuntu.com/pro/attach</property>
38+ </object>
39+ </child>
40+ </object>
41+ </child>
42+ <child>
43+ <object class="GtkLabel">
44+ <property name="label" translatable="yes">Enter code on &lt;a href="https://ubuntu.com/pro/attach"&gt;ubuntu.com/pro/attach&lt;/a&gt;</property>
45+ <property name="visible">True</property>
46+ <property name="use-markup">True</property>
47+ </object>
48+ </child>
49+ </object>
50+ </child>
51 <child>
52 <object class="GtkBox">
53 <property name="visible">True</property>
54@@ -93,15 +111,33 @@
55 </object>
56 </child>
57 <child>
58- <object class="GtkRadioButton" id="token_radio">
59- <property name="label" translatable="yes">Or add token manually</property>
60+ <object class="GtkBox">
61 <property name="visible">True</property>
62- <property name="can-focus">True</property>
63- <property name="receives-default">False</property>
64+ <property name="can-focus">False</property>
65+ <property name="orientation">horizontal</property>
66 <property name="margin-top">6</property>
67- <property name="xalign">0</property>
68- <property name="group">magic_radio</property>
69- <signal name="toggled" handler="on_radio_toggled" swapped="no"/>
70+ <property name="spacing">4</property>
71+ <child>
72+ <object class="GtkRadioButton" id="token_radio">
73+ <property name="visible">True</property>
74+ <property name="can-focus">True</property>
75+ <property name="receives-default">False</property>
76+ <property name="xalign">0</property>
77+ <property name="group">magic_radio</property>
78+ <signal name="toggled" handler="on_radio_toggled" swapped="no"/>
79+ <child internal-child="accessible">
80+ <object class="AtkObject">
81+ <property name="AtkObject::accessible-name" translatable="yes">Add token manually</property>
82+ </object>
83+ </child>
84+ </object>
85+ </child>
86+ <child>
87+ <object class="GtkLabel">
88+ <property name="label" translatable="yes">Or add token manually</property>
89+ <property name="visible">True</property>
90+ </object>
91+ </child>
92 </object>
93 </child>
94 <child>

Subscribers

People subscribed via source and target branches