Difference between revisions of "Accessibility"

From Gramps
Jump to: navigation, search
m (Into Glade)
(Accessibility support)
 
(47 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Accessibility support=
+
The Gramps project aims to provide the best [https://en.wikipedia.org/wiki/Computer_accessibility Computer accessibility] support.
  
==Links==
+
Unfortunately, not all parts of the Gramps interface have been tested for persons with disabilities.
 +
 
 +
The Gramps team will try to do its best to support complete accessibility.
 +
 
 +
==Accessibility support==
 +
 
 +
===Into Glade===
 +
 
 +
In addition to [https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-add-accelerator accelerators], ''[https://developer.gnome.org/gtk3/stable/GtkWidget.html GtkWidget]'' also support a custom <accessible> element, which supports actions and relations. Properties on the accessible implementation of an object can be set by accessing the internal child "accessible" of a ''[https://developer.gnome.org/gtk3/stable/GtkWidget.html GtkWidget]''. See [https://developer.gnome.org/gtk3/stable/GtkBuilder.html GtkBuilder UI].
 +
 
 +
* Gtk label
 +
 
 +
''A [https://developer.gnome.org/gtk3/stable/GtkLabel.html GtkLabel]'' '''with mnemonic support''' will automatically generate accessibility keys on linked ''[https://developer.gnome.org/gtk3/stable/GtkEntry.html GtkEntry]'' and ''UndoableEntry'' fields. Remember that Gramps also uses custom widgets like ''StyledTextEditor'' and ''ValidatableMaskedEntry'', which do not always have relation with a ''GtkLabel''.
 +
 
 +
* Toggle buttons and Icons on toolbar
 +
 
 +
Gramps often uses ''[https://developer.gnome.org/gtk3/stable/GtkToggleButton.html GtkToggleButtons]'' and alone ''[https://developer.gnome.org/gtk3/stable/GtkImage.html GtkImage]'' (image without label), this excludes blind people and generates a poor interface for accessibility.
 +
 
 +
====Rules for images and buttons====
  
* [http://projects.gnome.org/accessibility/ GNOME Accessibility] provides some guidances:
+
# Set a name (eg, same as tooltip) for a button with image.
** http://library.gnome.org/users/gnome-help/stable/a11y.html
+
# Set a description for all images and icons.
** http://library.gnome.org/users/gnome-access-guide/stable/
 
** http://developer.gnome.org/accessibility-devel-guide/stable/
 
  
* [http://accessibility.kde.org/ KDE accessibility team] is a small on-line community of developers and other volunteers dedicated to ensure that our favorite desktop is accessible to all users, including those of us with physical handicaps.
+
<object class="GtkButton" id="date_edit">
** http://accessibility.kde.org/developer/atk.php
+
  <property name="visible">True</property>
** http://accessibility.kde.org/developer/comparision.php
+
  <property name="can_focus">True</property>
** http://accessibility.kde.org/developer/bridge.php
+
  <property name="receives_default">True</property>
 +
  <property name="has_tooltip">True</property>
 +
  <property name="tooltip_text" translatable="yes">Invoke date editor</property>
 +
  <property name="relief">none</property>
 +
  <child internal-child="accessible">
 +
    <object class="AtkObject" id="date_edit-atkobject">
 +
      <property name="AtkObject::accessible-name" translatable="yes">Date</property>
 +
    </object>
 +
  </child>
 +
  <child>
 +
    <object class="GtkImage" id="image2264">
 +
      <property name="visible">True</property>
 +
      <property name="icon_name">gramps-date</property>
 +
      <child internal-child="accessible">
 +
        <object class="AtkObject" id="image2264-atkobject">
 +
          <property name="AtkObject::accessible-description" translatable="yes">Date</property>
 +
        </object>
 +
      </child>
 +
    </object>
 +
  </child>
 +
</object>
  
* [http://www.aegis-project.eu/ AEGIS] acronym stands for ''Open Accessibility Everywhere: Groundwork, Infrastructure, Standards''.
+
====Rules for labels and buttons====
  
* [http://www.projectpossibility.org/ Possibility] project is a nonprofit organization dedicated to creating groundbreaking open source software for persons with disabilities.
+
* A label for others widgets should use mnemonic_widget() or a relation.
  
==Gramps==
+
<object class="GtkLabel" id="label2">
 +
  <property name="visible">True</property>
 +
  <property name="xalign">0</property>
 +
  <property name="label" translatable="yes">La_bel:</property>
 +
  <property name="use_underline">True</property>
 +
  <property name="justify">center</property>
 +
  <property name="mnemonic_widget">related_label_entry_name</property>
 +
</object>
  
Gramps aims to provide the best accessibility support.
+
<object class="GtkButton" id="button1">
Unfortunatly, all parts of the interface have not been always tested for persons with disabilities.
+
  <property name="visible">True</property>
Gramps team try to do its best for a complete accessibility support.
+
  <property name="can_focus">True</property>
 +
  <property name="receives_default">True</property>
 +
  <accessibility>
 +
    <relation type="labelled-by" target="label4"/>
 +
  </accessibility>
 +
</object>
  
===Into Glade===
+
====Rules for entry====
  
* Gtk label
+
* Set a name (eg, same as tooltip) if there is no linked mnemonic_widget() on a label.
  
''[http://developer.gnome.org/gtk/2.24/GtkLabel.html GtkLabel]'' automaticaly generates accessibility keys on next ''[http://developer.gnome.org/gtk/2.24/GtkEntry.html GtkEntry]]'' and ''UndoableEntry'' fields.
+
<object class="StyledTextEditor" id="styled_text1">
Remember that Gramps also uses custom widgets like ''StyledTextEditor'' and ''ValidatableMaskedEntry'', which do not always provide relation with a ''GtkLabel''.
+
  <property name="visible">True</property>
 +
  <property name="can_focus">True</property>
 +
  <child internal-child="accessible">
 +
    <object class="AtkObject" id="styled_text1-atkobject">
 +
      <property name="AtkObject::accessible-name" translatable="yes">Styled Text Editor</property>
 +
    </object>
 +
  </child>
 +
</object>
  
* Toggle buttons and Icons on toolbar
+
====Focus and tooltip====
  
Gramps often uses ''[http://developer.gnome.org/gtk/2.24/GtkToggleButton.html GtkToggleButtons]'' and alone image (no label), this excludes blind people and generates a poor interface for accessibility.
 
  
====Rules (draft)====
+
* Think on focus for button.
  
# set a name for a button with image => like atk_object_set_name()
+
<object class="GtkToggleButton" id="togglebutton1">
# alternative to tooltip is the description => like atk_object_set_description()
+
  <property name="visible">True</property>
# for all images and icons use something => like atk_image_set_description()
+
  <property name="can_focus">True</property>
# a label for other widget should use mnemonic_widget() or a relation => like atk_relation_set_add_relation()
+
  <property name="has_focus">True</property>
 +
  <property name="is_focus">True</property>
 +
  <property name="receives_default">True</property>
 +
  <property name="active">True</property>
 +
  <property name="draw_indicator">True</property>
 +
</object>
  
'''''TODO''''' need to look further for better tricks (''previous and next sections'') and use of tooltip with ATK.
+
* Think on tooltip.
  
Think on accessibility support for widgets without Gtk label or alone image on a toggle button, by adding:
+
  <property name="has_tooltip">True</property>
  <property name="AtkObject::accessible-name" translatable="yes" comments="">Name access</property>
+
  <property name="tooltip_text" translatable="yes">Display a tooltip</property>
...
 
  <accessibility>
 
  <relation type="labelled-by" target="label209"/>
 
</accessibility>
 
  
 
===Into python===
 
===Into python===
  
====Sample====
+
====ATK object====
  
 
  # mark the root of this window with its PID so we can easily identify it
 
  # mark the root of this window with its PID so we can easily identify it
Line 63: Line 118:
 
  label_acc.add_relationship(atk.RelationType.LABEL_FOR, entry_acc)
 
  label_acc.add_relationship(atk.RelationType.LABEL_FOR, entry_acc)
 
  entry_acc.add_relationship(atk.RelationType.LABELLED_BY, label_acc)
 
  entry_acc.add_relationship(atk.RelationType.LABELLED_BY, label_acc)
 +
 +
====Focus====
 +
 +
Sample for setting the [http://developer.gnome.org/gtk/2.24/GtkWidget.html#gtk-widget-grab-focus focus] on the date field if that date field is empty:
 +
 +
def _post_init(self):
 +
    date = self.top.get_object('eer_date_entry')
 +
    if not date.get_text_length():
 +
        date.grab_focus();
  
 
====Validate====
 
====Validate====
  
[http://live.gnome.org/Accerciser/ Accerciser] provides a [http://live.gnome.org/Accerciser/Validate AT-SPI Validator Plugin] {{bug|5301#c21471}}.
+
[http://live.gnome.org/Accerciser/ Accerciser] provides an [http://live.gnome.org/Accerciser/Validate AT-SPI Validator Plugin] #{{bug|5313}}.
 +
 
 +
==Visual impairment==
  
===Bugs and feature requests===
+
It is helpful to use large fonts, high DPI displays, high-contrast themes and icons supplemented with auditory feedback and screen magnifying software.
  
 +
About 8% of men and about 0.4% of women have some form of color-blindness.
 +
 +
==Links==
 +
 +
* [https://wiki.gnome.org/Accessibility GNOME Accessibility] provides some guidances:
 +
** https://help.gnome.org/users/gnome-help/stable/a11y.html
 +
** http://library.gnome.org/users/gnome-access-guide/stable/  (link 404 gone)
 +
** https://developer.gnome.org/accessibility-devel-guide/stable/
 +
 +
* [http://accessibility.kde.org/ KDE accessibility team] is a small on-line community of developers and other volunteers dedicated to ensure that our favorite desktop is accessible to all users, including those of us with physical handicaps.
 +
** http://accessibility.kde.org/developer/atk.php
 +
** http://accessibility.kde.org/developer/comparision.php
 +
** http://accessibility.kde.org/developer/bridge.php
 +
 +
* [http://www.aegis-project.eu/ AEGIS] acronym stands for ''Open Accessibility Everywhere: Groundwork, Infrastructure, Standards''.
 +
 +
* [http://www.projectpossibility.org/ Possibility] project is a nonprofit organization dedicated to creating groundbreaking open source software for persons with disabilities.
 +
 +
* [http://accelibreinfo.eu Accelibreinfo]: a new eye on computing, improve the accessibility and setting computer.
 +
 +
==Bugs and feature requests==
 +
 +
* #{{bug|2519}}: Pressing 'Enter' should normally activate OK
 
* #{{bug|3069}}: GtkTreeView is very slow / crashes with Assistive Technologies / ATK / a11y enabled
 
* #{{bug|3069}}: GtkTreeView is very slow / crashes with Assistive Technologies / ATK / a11y enabled
 
* #{{bug|5301}}: ATK support
 
* #{{bug|5301}}: ATK support
 
* #{{bug|5308}}: Review focus on Editors with toggle buttons
 
* #{{bug|5308}}: Review focus on Editors with toggle buttons
 
* #{{bug|5309}}: Review ValidatableMaskedEntry for a better Accessibility support
 
* #{{bug|5309}}: Review ValidatableMaskedEntry for a better Accessibility support
 +
* #{{bug|5310}}: Missing Date field on MediaRef Editor
 +
* #{{bug|5312}}: Make tooltip on date edition toggle button consistent
 +
* #{{bug|5313}}: AT-SPI issues
 +
* #{{bug|5314}}: Missing Tags environment on MediaRef Editor
 +
* #{{bug|5320}}: Privacy icon/button is not consistent
 +
* #{{bug|5349}}: Filter and "Quick Filter" are not applied when you press [Enter]
 +
* #{{bug|5350}}: Focus on the "Quick Filter" field is lost after clicking on "Find"
 +
* #{{bug|5351}}: Focus on event window should be set to "Event type" by default
 +
 +
= Related pages =
 +
 +
* [[Usability]]
 +
* [[OptimizeMenuNames]]
  
 
[[Category:Developers/General]]
 
[[Category:Developers/General]]
 +
[[Category:Developers/Design]]

Latest revision as of 21:22, 2 April 2022

The Gramps project aims to provide the best Computer accessibility support.

Unfortunately, not all parts of the Gramps interface have been tested for persons with disabilities.

The Gramps team will try to do its best to support complete accessibility.

Accessibility support

Into Glade

In addition to accelerators, GtkWidget also support a custom <accessible> element, which supports actions and relations. Properties on the accessible implementation of an object can be set by accessing the internal child "accessible" of a GtkWidget. See GtkBuilder UI.

  • Gtk label

A GtkLabel with mnemonic support will automatically generate accessibility keys on linked GtkEntry and UndoableEntry fields. Remember that Gramps also uses custom widgets like StyledTextEditor and ValidatableMaskedEntry, which do not always have relation with a GtkLabel.

  • Toggle buttons and Icons on toolbar

Gramps often uses GtkToggleButtons and alone GtkImage (image without label), this excludes blind people and generates a poor interface for accessibility.

Rules for images and buttons

  1. Set a name (eg, same as tooltip) for a button with image.
  2. Set a description for all images and icons.
<object class="GtkButton" id="date_edit">
  <property name="visible">True</property>
  <property name="can_focus">True</property>
  <property name="receives_default">True</property>
  <property name="has_tooltip">True</property>
  <property name="tooltip_text" translatable="yes">Invoke date editor</property>
  <property name="relief">none</property>
  <child internal-child="accessible">
    <object class="AtkObject" id="date_edit-atkobject">
      <property name="AtkObject::accessible-name" translatable="yes">Date</property>
    </object>
  </child>
  <child>
    <object class="GtkImage" id="image2264">
      <property name="visible">True</property>
      <property name="icon_name">gramps-date</property>
      <child internal-child="accessible">
        <object class="AtkObject" id="image2264-atkobject">
          <property name="AtkObject::accessible-description" translatable="yes">Date</property>
        </object>
      </child>
    </object>
  </child>
</object>

Rules for labels and buttons

  • A label for others widgets should use mnemonic_widget() or a relation.
<object class="GtkLabel" id="label2">
  <property name="visible">True</property>
  <property name="xalign">0</property>
  <property name="label" translatable="yes">La_bel:</property>
  <property name="use_underline">True</property>
  <property name="justify">center</property>
  <property name="mnemonic_widget">related_label_entry_name</property>
</object>
<object class="GtkButton" id="button1">
  <property name="visible">True</property>
  <property name="can_focus">True</property>
  <property name="receives_default">True</property>
  <accessibility>
    <relation type="labelled-by" target="label4"/>
  </accessibility>
</object>

Rules for entry

  • Set a name (eg, same as tooltip) if there is no linked mnemonic_widget() on a label.
<object class="StyledTextEditor" id="styled_text1">
  <property name="visible">True</property>
  <property name="can_focus">True</property>
  <child internal-child="accessible">
    <object class="AtkObject" id="styled_text1-atkobject">
      <property name="AtkObject::accessible-name" translatable="yes">Styled Text Editor</property>
    </object>
  </child>
</object>

Focus and tooltip

  • Think on focus for button.
<object class="GtkToggleButton" id="togglebutton1">
  <property name="visible">True</property>
  <property name="can_focus">True</property>
  <property name="has_focus">True</property>
  <property name="is_focus">True</property>
  <property name="receives_default">True</property>
  <property name="active">True</property>
  <property name="draw_indicator">True</property>
</object>
  • Think on tooltip.
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Display a tooltip</property>

Into python

ATK object

# mark the root of this window with its PID so we can easily identify it
# as this app
root_atk = atk.get_root()
root_atk.set_description(str(os.getpid()))
label_acc = label_widget.get_accessible()
entry_acc = entry.get_accessible()
label_acc.add_relationship(atk.RelationType.LABEL_FOR, entry_acc)
entry_acc.add_relationship(atk.RelationType.LABELLED_BY, label_acc)

Focus

Sample for setting the focus on the date field if that date field is empty:

def _post_init(self):
    date = self.top.get_object('eer_date_entry')
    if not date.get_text_length():
        date.grab_focus();

Validate

Accerciser provides an AT-SPI Validator Plugin #5313.

Visual impairment

It is helpful to use large fonts, high DPI displays, high-contrast themes and icons supplemented with auditory feedback and screen magnifying software.

About 8% of men and about 0.4% of women have some form of color-blindness.

Links

  • AEGIS acronym stands for Open Accessibility Everywhere: Groundwork, Infrastructure, Standards.
  • Possibility project is a nonprofit organization dedicated to creating groundbreaking open source software for persons with disabilities.
  • Accelibreinfo: a new eye on computing, improve the accessibility and setting computer.

Bugs and feature requests

  • #2519: Pressing 'Enter' should normally activate OK
  • #3069: GtkTreeView is very slow / crashes with Assistive Technologies / ATK / a11y enabled
  • #5301: ATK support
  • #5308: Review focus on Editors with toggle buttons
  • #5309: Review ValidatableMaskedEntry for a better Accessibility support
  • #5310: Missing Date field on MediaRef Editor
  • #5312: Make tooltip on date edition toggle button consistent
  • #5313: AT-SPI issues
  • #5314: Missing Tags environment on MediaRef Editor
  • #5320: Privacy icon/button is not consistent
  • #5349: Filter and "Quick Filter" are not applied when you press [Enter]
  • #5350: Focus on the "Quick Filter" field is lost after clicking on "Find"
  • #5351: Focus on event window should be set to "Event type" by default

Related pages