Difference between revisions of "Accessibility"

From Gramps
Jump to: navigation, search
m (Into Glade)
(Into Glade)
Line 27: Line 27:
 
* Gtk label
 
* Gtk 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.
+
''A [http://developer.gnome.org/gtk/2.24/GtkLabel.html GtkLabel]'' '''with mnemonic support''' will automaticaly generate accessibility keys on linked ''[http://developer.gnome.org/gtk/2.24/GtkEntry.html GtkEntry]'' and ''UndoableEntry'' fields.
Remember that Gramps also uses custom widgets like ''StyledTextEditor'' and ''ValidatableMaskedEntry'', which do not always provide relation with a ''GtkLabel''.
+
 
 +
Remember that Gramps also uses custom widgets like ''StyledTextEditor'' and ''ValidatableMaskedEntry'', which do not always provide relation with a ''GtkLabel''. In this case, we need to set a relation.
  
 
* Toggle buttons and Icons on toolbar
 
* Toggle buttons and Icons on toolbar
Line 67: Line 68:
  
 
* a label for other widget should use mnemonic_widget() or a relation
 
* a label for other widget 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">
 
  <object class="GtkButton" id="button1">
Line 88: Line 98:
 
   <property name="draw_indicator">True</property>
 
   <property name="draw_indicator">True</property>
 
  </object>
 
  </object>
 
'''''TODO''''' need to look further for mnemonic_widget() and focus.
 
  
 
===Into python===
 
===Into python===

Revision as of 03:36, 20 October 2011

Accessibility support

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.

Gramps

Gramps aims to provide the best accessibility support. Unfortunatly, all parts of the interface have not been always tested for persons with disabilities. Gramps team try to do its best for a complete accessibility support.

Into Glade

  • Gtk label

A GtkLabel with mnemonic support will automaticaly generate accessibility keys on linked GtkEntry and UndoableEntry fields.

Remember that Gramps also uses custom widgets like StyledTextEditor and ValidatableMaskedEntry, which do not always provide relation with a GtkLabel. In this case, we need to set a relation.

  • Toggle buttons and Icons on toolbar

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

Rules for images and buttons

  1. set a name 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 edition</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 edition</property>
        </object>
      </child>
    </object>
  </child>
</object>

Rules for labels and buttons

  • a label for other widget 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>
  • 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>

Into python

Sample

# 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)

Validate

Accerciser provides a AT-SPI Validator Plugin #5313.

Bugs and feature requests

  • #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