[gnome-software: 41/110] Use new GTK accessibility APIs
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 41/110] Use new GTK accessibility APIs
- Date: Tue, 5 Oct 2021 20:32:37 +0000 (UTC)
commit 2076ffd6051decba12f41f2610db928588f5004f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Aug 23 13:52:10 2021 -0300
Use new GTK accessibility APIs
It turns out to be much simpler than ATK, and we're removing
more lines than adding. A few things worth noticing:
* What ATK called "name" is the "label" accessible property
* Setting a role is now done at class_init
po/POTFILES.in | 1 +
src/gs-age-rating-context-dialog.ui | 5 +---
src/gs-app-context-bar.ui | 40 +++++++------------------------
src/gs-app-details-page.ui | 8 +++----
src/gs-app-translation-dialog.ui | 5 +---
src/gs-category-page.ui | 18 +++++++-------
src/gs-context-dialog-row.ui | 16 ++++---------
src/gs-details-page.ui | 18 ++++++--------
src/gs-extras-page.ui | 8 +++----
src/gs-feature-tile.c | 11 ++++-----
src/gs-featured-carousel.c | 1 +
src/gs-featured-carousel.ui | 25 +++++++------------
src/gs-hardware-support-context-dialog.ui | 5 +---
src/gs-installed-page.ui | 8 +++----
src/gs-loading-page.ui | 8 +++----
src/gs-moderate-page.ui | 8 +++----
src/gs-overview-page.ui | 24 +++++++------------
src/gs-picture.c | 14 ++++-------
src/gs-safety-context-dialog.ui | 28 +++++-----------------
src/gs-screenshot-carousel.ui | 20 +++++++---------
src/gs-screenshot-image.c | 20 ++++++----------
src/gs-screenshot-image.ui | 3 +++
src/gs-search-page.ui | 8 +++----
src/gs-shell.ui | 32 ++++++++++---------------
src/gs-storage-context-dialog.ui | 5 +---
src/gs-summary-tile.c | 11 ++++-----
src/gs-updates-page.c | 7 +++---
src/gs-updates-page.ui | 8 +++----
src/gs-updates-section.ui | 5 +---
29 files changed, 126 insertions(+), 244 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 407b70111..201e07183 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -79,6 +79,7 @@ src/gs-safety-context-dialog.c
src/gs-safety-context-dialog.ui
src/gs-screenshot-carousel.ui
src/gs-screenshot-image.c
+src/gs-screenshot-image.ui
src/gs-search-page.c
src/gs-search-page.ui
src/gs-shell.c
diff --git a/src/gs-age-rating-context-dialog.ui b/src/gs-age-rating-context-dialog.ui
index d462d81dd..c1f52b291 100644
--- a/src/gs-age-rating-context-dialog.ui
+++ b/src/gs-age-rating-context-dialog.ui
@@ -40,7 +40,7 @@
<property name="visible">True</property>
<property name="xalign">0.5</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
+ <relation name="labelled-by">title</relation>
</accessibility>
</object>
<packing>
@@ -64,9 +64,6 @@
<style>
<class name="title-1"/>
</style>
- <accessibility>
- <relation target="lozenge" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
diff --git a/src/gs-app-context-bar.ui b/src/gs-app-context-bar.ui
index f3a839ab9..2545359d2 100644
--- a/src/gs-app-context-bar.ui
+++ b/src/gs-app-context-bar.ui
@@ -44,8 +44,8 @@
<property name="visible">True</property>
<property name="xalign">0.5</property>
<accessibility>
- <relation target="storage_tile_title" type="labelled-by"/>
- <relation target="storage_tile_description" type="details"/>
+ <relation name="labelled-by">storage_tile_title</relation>
+ <relation name="details">storage_tile_description</relation>
</accessibility>
</object>
<packing>
@@ -63,9 +63,6 @@
<property name="label">Download Size</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="storage_tile_lozenge_content" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
@@ -79,9 +76,6 @@
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="storage_tile_lozenge_content" type="details-for"/>
- </accessibility>
<style>
<class name="context-tile-description"/>
</style>
@@ -120,8 +114,8 @@
<property name="icon-name">safety-symbolic</property>
<property name="visible">True</property>
<accessibility>
- <relation target="safety_tile_title" type="labelled-by"/>
- <relation target="safety_tile_description" type="details"/>
+ <relation name="labelled-by">safety_tile_title</relation>
+ <relation name="details">safety_tile_description</relation>
</accessibility>
</object>
<packing>
@@ -139,9 +133,6 @@
<property name="label">Safe</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="safety_tile_lozenge_content" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
@@ -155,9 +146,6 @@
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="safety_tile_lozenge_content" type="details-for"/>
- </accessibility>
<style>
<class name="context-tile-description"/>
</style>
@@ -206,8 +194,8 @@
<property name="pixel-size">56</property>
<property name="visible">True</property>
<accessibility>
- <relation target="hardware_support_tile_title" type="labelled-by"/>
- <relation target="hardware_support_tile_description" type="details"/>
+ <relation name="labelled-by">hardware_support_tile_title</relation>
+ <relation name="details">hardware_support_tile_description</relation>
</accessibility>
</object>
<packing>
@@ -225,9 +213,6 @@
<property name="label">Adaptive</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="hardware_support_tile_lozenge_content" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
@@ -241,9 +226,6 @@
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="hardware_support_tile_lozenge_content" type="details-for"/>
- </accessibility>
<style>
<class name="context-tile-description"/>
</style>
@@ -283,8 +265,8 @@
<property name="visible">True</property>
<property name="xalign">0.5</property>
<accessibility>
- <relation target="age_rating_tile_title" type="labelled-by"/>
- <relation target="age_rating_tile_description" type="details"/>
+ <relation name="labelled-by">age_rating_tile_title</relation>
+ <relation name="details">age_rating_tile_description</relation>
</accessibility>
</object>
<packing>
@@ -302,9 +284,6 @@
<property name="label" translatable="yes">Age Rating</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="age_rating_tile_lozenge_content" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
@@ -318,9 +297,6 @@
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="xalign">0.5</property>
- <accessibility>
- <relation target="age_rating_tile_lozenge_content" type="details-for"/>
- </accessibility>
<style>
<class name="context-tile-description"/>
</style>
diff --git a/src/gs-app-details-page.ui b/src/gs-app-details-page.ui
index 85ce25464..aa3c0065b 100644
--- a/src/gs-app-details-page.ui
+++ b/src/gs-app-details-page.ui
@@ -17,11 +17,9 @@
<style>
<class name="image-button"/>
</style>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Go back</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Go back</property>
+ </accessibility>
<child>
<object class="GtkImage">
<property name="visible">True</property>
diff --git a/src/gs-app-translation-dialog.ui b/src/gs-app-translation-dialog.ui
index 157130cf4..38da32b43 100644
--- a/src/gs-app-translation-dialog.ui
+++ b/src/gs-app-translation-dialog.ui
@@ -41,7 +41,7 @@
<property name="icon-size">3</property><!-- GTK_ICON_SIZE_LARGE_TOOLBAR -->
<property name="visible">True</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
+ <relation name="labelled-by">title</relation>
</accessibility>
</object>
<packing>
@@ -65,9 +65,6 @@
<style>
<class name="title-1"/>
</style>
- <accessibility>
- <relation target="lozenge" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
diff --git a/src/gs-category-page.ui b/src/gs-category-page.ui
index 0346fb73b..fce0bbbbe 100644
--- a/src/gs-category-page.ui
+++ b/src/gs-category-page.ui
@@ -43,9 +43,6 @@
<property name="xalign">0</property>
<property name="margin_top">24</property>
<property name="label" translatable="yes" comments="Heading for featured apps on a
category page">Editor’s Choice</property>
- <accessibility>
- <relation target="featured_flow_box" type="label-for"/>
- </accessibility>
<style>
<class name="index-title-alignment-software"/>
</style>
@@ -62,6 +59,9 @@
<property name="vexpand">True</property>
<property name="valign">start</property>
<property name="selection-mode">none</property>
+ <accessibility>
+ <relation name="labelled-by">featured_heading</relation>
+ </accessibility>
</object>
</child>
@@ -71,9 +71,6 @@
<property name="xalign">0</property>
<property name="margin_top">24</property>
<property name="label" translatable="yes" comments="Heading for recently updated
apps on a category page">New & Updated</property>
- <accessibility>
- <relation target="recently_updated_flow_box" type="label-for"/>
- </accessibility>
<style>
<class name="index-title-alignment-software"/>
</style>
@@ -90,6 +87,9 @@
<property name="vexpand">True</property>
<property name="valign">start</property>
<property name="selection-mode">none</property>
+ <accessibility>
+ <relation name="labelled-by">recently_updated_heading</relation>
+ </accessibility>
</object>
</child>
@@ -99,9 +99,6 @@
<property name="xalign">0</property>
<property name="margin_top">24</property>
<property name="label" translatable="yes" comments="Heading for the rest of the apps
on a category page">Other Software</property>
- <accessibility>
- <relation target="category_detail_box" type="label-for"/>
- </accessibility>
<style>
<class name="index-title-alignment-software"/>
</style>
@@ -118,6 +115,9 @@
<property name="vexpand">True</property>
<property name="valign">start</property>
<property name="selection-mode">none</property>
+ <accessibility>
+ <relation name="labelled-by">other_heading</relation>
+ </accessibility>
</object>
</child>
</object>
diff --git a/src/gs-context-dialog-row.ui b/src/gs-context-dialog-row.ui
index edeabdf48..36a5556b7 100644
--- a/src/gs-context-dialog-row.ui
+++ b/src/gs-context-dialog-row.ui
@@ -29,8 +29,8 @@
<property name="pixel-size">16</property>
<property name="visible">True</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
- <relation target="description" type="details"/>
+ <relation name="labelled-by">title</relation>
+ <relation name="details">description</relation>
</accessibility>
</object>
<packing>
@@ -45,8 +45,8 @@
<property name="visible">False</property>
<property name="xalign">0.5</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
- <relation target="description" type="details"/>
+ <relation name="labelled-by">title</relation>
+ <relation name="details">description</relation>
</accessibility>
</object>
<packing>
@@ -69,10 +69,6 @@
<property name="label">Download Size</property>
<property name="visible">True</property>
<property name="xalign">0</property>
- <accessibility>
- <relation target="lozenge_content_image" type="label-for"/>
- <relation target="lozenge_content_text" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
@@ -85,10 +81,6 @@
<property name="visible">True</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
- <accessibility>
- <relation target="lozenge_content_image" type="details-for"/>
- <relation target="lozenge_content_text" type="details-for"/>
- </accessibility>
<style>
<class name="context-tile-description"/>
</style>
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index 120f089d3..1d1814bd5 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -3,11 +3,9 @@
<requires lib="gtk+" version="3.10"/>
<requires lib="handy" version="1.0"/>
<template class="GsDetailsPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="details-accessible">
- <property name="accessible-name" translatable="yes">Details page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Details page</property>
+ </accessibility>
<child>
<object class="GtkStack" id="stack_details">
<property name="visible">True</property>
@@ -289,12 +287,10 @@
<property name="visible">True</property>
</object>
</child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <!-- TRANSLATORS: button text in the header when an
application can be erased -->
- <property name="accessible-name"
translatable="yes">Uninstall</property>
- </object>
- </child>
+ <accessibility>
+ <!-- TRANSLATORS: button text in the header when an
application can be erased -->
+ <property name="label" translatable="yes">Uninstall</property>
+ </accessibility>
</object>
</child>
<child>
diff --git a/src/gs-extras-page.ui b/src/gs-extras-page.ui
index a4c2e6074..f734124b4 100644
--- a/src/gs-extras-page.ui
+++ b/src/gs-extras-page.ui
@@ -2,11 +2,9 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GsExtrasPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="codecs-accessible">
- <property name="accessible-name" translatable="yes">Codecs page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Codecs page</property>
+ </accessibility>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index f3c536b21..7ad2293a5 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -177,7 +177,6 @@ gs_feature_tile_refresh (GsAppTile *self)
{
GsFeatureTile *tile = GS_FEATURE_TILE (self);
GsApp *app = gs_app_tile_get_app (self);
- AtkObject *accessible;
const gchar *markup = NULL;
g_autofree gchar *name = NULL;
GtkStyleContext *context;
@@ -369,8 +368,6 @@ gs_feature_tile_refresh (GsAppTile *self)
}
}
- accessible = gtk_widget_get_accessible (GTK_WIDGET (tile));
-
switch (gs_app_get_state (app)) {
case GS_APP_STATE_INSTALLED:
case GS_APP_STATE_REMOVING:
@@ -387,9 +384,11 @@ gs_feature_tile_refresh (GsAppTile *self)
break;
}
- if (GTK_IS_ACCESSIBLE (accessible) && name != NULL) {
- atk_object_set_name (accessible, name);
- atk_object_set_description (accessible, gs_app_get_summary (app));
+ if (name != NULL) {
+ gtk_accessible_update_property (GTK_ACCESSIBLE (tile),
+ GTK_ACCESSIBLE_PROPERTY_LABEL, name,
+ GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, gs_app_get_summary (app),
+ -1);
}
}
diff --git a/src/gs-featured-carousel.c b/src/gs-featured-carousel.c
index 0c15591b6..f51abed0f 100644
--- a/src/gs-featured-carousel.c
+++ b/src/gs-featured-carousel.c
@@ -363,6 +363,7 @@ gs_featured_carousel_class_init (GsFeaturedCarouselClass *klass)
widget_class->activate_signal = obj_signals[SIGNAL_CLICKED];
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-featured-carousel.ui");
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GROUP);
gtk_widget_class_bind_template_child (widget_class, GsFeaturedCarousel, carousel);
gtk_widget_class_bind_template_child (widget_class, GsFeaturedCarousel, next_button);
diff --git a/src/gs-featured-carousel.ui b/src/gs-featured-carousel.ui
index d416c2a44..eea2ee94e 100644
--- a/src/gs-featured-carousel.ui
+++ b/src/gs-featured-carousel.ui
@@ -38,11 +38,9 @@
<property name="height-request">56</property>
<property name="margin">9</property>
<signal name="clicked" handler="previous_button_clicked_cb"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Previous</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Previous</property>
+ </accessibility>
<style>
<class name="osd"/>
<class name="featured-button-left"/>
@@ -68,11 +66,9 @@
<property name="height-request">56</property>
<property name="margin">9</property>
<signal name="clicked" handler="next_button_clicked_cb"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Next</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Next</property>
+ </accessibility>
<style>
<class name="osd"/>
<class name="featured-button-right"/>
@@ -95,11 +91,8 @@
<property name="visible">True</property>
</object>
</child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Featured Apps List</property>
- <property name="accessible-role">grouping</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Featured Apps List</property>
+ </accessibility>
</template>
</interface>
diff --git a/src/gs-hardware-support-context-dialog.ui b/src/gs-hardware-support-context-dialog.ui
index bd6c467ae..41128f71b 100644
--- a/src/gs-hardware-support-context-dialog.ui
+++ b/src/gs-hardware-support-context-dialog.ui
@@ -40,7 +40,7 @@
<property name="pixel-size">24</property>
<property name="visible">True</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
+ <relation name="labelled-by">title</relation>
</accessibility>
</object>
<packing>
@@ -64,9 +64,6 @@
<style>
<class name="title-1"/>
</style>
- <accessibility>
- <relation target="lozenge" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
diff --git a/src/gs-installed-page.ui b/src/gs-installed-page.ui
index 74241f573..c0d9e8820 100644
--- a/src/gs-installed-page.ui
+++ b/src/gs-installed-page.ui
@@ -2,11 +2,9 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GsInstalledPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="installed-accessible">
- <property name="accessible-name" translatable="yes">Installed page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Installed page</property>
+ </accessibility>
<child>
<object class="GtkStack" id="stack_install">
<property name="visible">True</property>
diff --git a/src/gs-loading-page.ui b/src/gs-loading-page.ui
index bf8acdd7a..c8201889f 100644
--- a/src/gs-loading-page.ui
+++ b/src/gs-loading-page.ui
@@ -2,11 +2,9 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GsLoadingPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="loading-accessible">
- <property name="accessible-name" translatable="yes">Loading page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Loading page</property>
+ </accessibility>
<child>
<object class="AdwStatusPage" id="status_page">
<property name="visible">True</property>
diff --git a/src/gs-moderate-page.ui b/src/gs-moderate-page.ui
index b82315d7e..ac940d1a9 100644
--- a/src/gs-moderate-page.ui
+++ b/src/gs-moderate-page.ui
@@ -2,11 +2,9 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GsModeratePage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="moderate-accessible">
- <property name="accessible-name" translatable="yes">Moderate page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Moderate page</property>
+ </accessibility>
<child>
<object class="GtkStack" id="stack_install">
<property name="visible">True</property>
diff --git a/src/gs-overview-page.ui b/src/gs-overview-page.ui
index 82ea6b4f7..86de47e76 100644
--- a/src/gs-overview-page.ui
+++ b/src/gs-overview-page.ui
@@ -3,11 +3,9 @@
<requires lib="gtk+" version="3.10"/>
<requires lib="handy" version="1.0"/>
<template class="GsOverviewPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="overview-accessible">
- <property name="accessible-name" translatable="yes">Overview page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Overview page</property>
+ </accessibility>
<child>
<object class="GtkStack" id="stack_overview">
<property name="visible">True</property>
@@ -117,9 +115,6 @@
<property name="label" translatable="yes" comments="Translators: This is a
heading for software which has been featured ('picked') by the distribution.">Editor’s
Choice</property>
<property name="margin-top">21</property>
<property name="margin-bottom">6</property>
- <accessibility>
- <relation target="box_popular" type="label-for"/>
- </accessibility>
<style>
<class name="index-title-alignment-software"/>
</style>
@@ -133,7 +128,7 @@
<property name="row-spacing">14</property>
<property name="valign">start</property>
<accessibility>
- <relation target="popular_heading" type="labelled-by"/>
+ <relation name="labelled-by">popular_heading</relation>
</accessibility>
</object>
</child>
@@ -145,9 +140,6 @@
<property name="label" translatable="yes" comments="Translators: This is a
heading for software which has been recently released upstream.">New & Updated</property>
<property name="margin-top">21</property>
<property name="margin-bottom">6</property>
- <accessibility>
- <relation target="box_recent" type="label-for"/>
- </accessibility>
<style>
<class name="index-title-alignment-software"/>
</style>
@@ -162,7 +154,7 @@
<property name="valign">start</property>
<property name="selection-mode">none</property>
<accessibility>
- <relation target="recent_heading" type="labelled-by"/>
+ <relation name="labelled-by">recent_heading</relation>
</accessibility>
</object>
</child>
@@ -174,9 +166,6 @@
<property name="label" translatable="yes" comments="Translators: This is a
heading for a list of categories.">Other Categories</property>
<property name="margin-top">21</property>
<property name="margin-bottom">6</property>
- <accessibility>
- <relation target="flowbox_iconless_categories" type="label-for"/>
- </accessibility>
<style>
<class name="index-title-alignment-software"/>
</style>
@@ -191,6 +180,9 @@
<property name="min_children_per_line">2</property>
<property name="max_children_per_line">3</property>
<property name="selection_mode">none</property>
+ <accessibility>
+ <relation name="labelled-by">iconless_categories_heading</relation>
+ </accessibility>
</object>
</child>
</object>
diff --git a/src/gs-picture.c b/src/gs-picture.c
index d07f6c0f2..1d6864615 100644
--- a/src/gs-picture.c
+++ b/src/gs-picture.c
@@ -21,7 +21,6 @@
#include "config.h"
#include <glib/gi18n.h>
-#include <gtk/gtk-a11y.h>
#include "gs-picture.h"
#include "gs-common.h"
@@ -350,14 +349,9 @@ gs_picture_set_property (GObject *object, guint prop_id, const GValue *value, GP
static void
gs_picture_init (GsPicture *picture)
{
- AtkObject *accessible;
-
- accessible = gtk_widget_get_accessible (GTK_WIDGET (picture));
- if (accessible != NULL) {
- atk_object_set_role (accessible, ATK_ROLE_IMAGE);
- /* Translators: This is the accessibility label for a screenshot. */
- atk_object_set_name (accessible, _("Picture"));
- }
+ gtk_accessible_update_property (GTK_ACCESSIBLE (picture),
+ GTK_ACCESSIBLE_PROPERTY_LABEL, _("Picture"),
+ -1);
}
static void
@@ -394,7 +388,7 @@ gs_picture_class_init (GsPictureClass *klass)
g_object_class_install_properties (object_class, G_N_ELEMENTS (obj_props), obj_props);
- gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_IMAGE_ACCESSIBLE);
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_IMG);
gtk_widget_class_set_css_name (widget_class, "picture");
}
diff --git a/src/gs-safety-context-dialog.ui b/src/gs-safety-context-dialog.ui
index 141927914..ebcf48493 100644
--- a/src/gs-safety-context-dialog.ui
+++ b/src/gs-safety-context-dialog.ui
@@ -40,7 +40,7 @@
<property name="pixel-size">24</property>
<property name="visible">True</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
+ <relation name="labelled-by">title</relation>
</accessibility>
</object>
<packing>
@@ -64,9 +64,6 @@
<style>
<class name="title-1"/>
</style>
- <accessibility>
- <relation target="lozenge" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
@@ -123,9 +120,6 @@
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="label" translatable="yes">License</property>
- <accessibility>
- <relation target="license_label" type="label-for"/>
- </accessibility>
</object>
</child>
<child>
@@ -139,7 +133,7 @@
<class name="dim-label"/>
</style>
<accessibility>
- <relation target="license_title" type="labelled-by"/>
+ <relation name="labelled-by">license_title</relation>
</accessibility>
</object>
</child>
@@ -166,9 +160,6 @@
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="label" translatable="yes" comments="Translators: This is
a heading for a row showing the origin/source of an app (such as ‘flathub’).">Source</property>
- <accessibility>
- <relation target="source_label" type="label-for"/>
- </accessibility>
</object>
</child>
<child>
@@ -182,7 +173,7 @@
<class name="dim-label"/>
</style>
<accessibility>
- <relation target="source_title" type="labelled-by"/>
+ <relation name="labelled-by">source_title</relation>
</accessibility>
</object>
</child>
@@ -209,9 +200,6 @@
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="label" translatable="yes">SDK</property>
- <accessibility>
- <relation target="sdk_label" type="label-for"/>
- </accessibility>
</object>
</child>
<child>
@@ -225,7 +213,7 @@
<class name="dim-label"/>
</style>
<accessibility>
- <relation target="sdk_title" type="labelled-by"/>
+ <relation name="labelled-by">sdk_title</relation>
</accessibility>
</object>
</child>
@@ -237,13 +225,9 @@
<class name="eol-red"/>
</style>
<accessibility>
- <relation target="sdk_title" type="labelled-by"/>
+ <property name="label" translatable="yes">Outdated SDK
version</property>
+ <relation name="labelled-by">sdk_title</relation>
</accessibility>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Outdated SDK
version</property>
- </object>
- </child>
</object>
</child>
</object>
diff --git a/src/gs-screenshot-carousel.ui b/src/gs-screenshot-carousel.ui
index d39eba6ab..8028514c7 100644
--- a/src/gs-screenshot-carousel.ui
+++ b/src/gs-screenshot-carousel.ui
@@ -38,12 +38,10 @@
<property name="height-request">64</property>
<property name="margin">9</property>
<signal name="clicked" handler="gs_screenshot_carousel_button_previous_clicked_cb"
swapped="yes"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <!-- Translators: This is the accessible description for a button to go to the
previous screenshot in the screenshot carousel. -->
- <property name="accessible-name" translatable="yes">Previous
Screenshot</property>
- </object>
- </child>
+ <accessibility>
+ <!-- Translators: This is the accessible description for a button to go to the
previous screenshot in the screenshot carousel. -->
+ <property name="label" translatable="yes">Previous Screenshot</property>
+ </accessibility>
<style>
<class name="circular"/>
<class name="osd"/>
@@ -79,12 +77,10 @@
<property name="height-request">64</property>
<property name="margin">9</property>
<signal name="clicked" handler="gs_screenshot_carousel_button_next_clicked_cb"
swapped="yes"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <!-- Translators: This is the accessible description for a button to go to the
next screenshot in the screenshot carousel. -->
- <property name="accessible-name" translatable="yes">Next Screenshot</property>
- </object>
- </child>
+ <accessibility>
+ <!-- Translators: This is the accessible description for a button to go to the
next screenshot in the screenshot carousel. -->
+ <property name="label" translatable="yes">Next Screenshot</property>
+ </accessibility>
<style>
<class name="circular"/>
<class name="osd"/>
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 8839651b2..3ddd289b7 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -643,11 +643,12 @@ void
gs_screenshot_image_set_description (GsScreenshotImage *ssimg,
const gchar *description)
{
- AtkImage *atk_image;
- atk_image = ATK_IMAGE (gtk_widget_get_accessible (ssimg->image1));
- atk_image_set_image_description (atk_image, description);
- atk_image = ATK_IMAGE (gtk_widget_get_accessible (ssimg->image2));
- atk_image_set_image_description (atk_image, description);
+ gtk_accessible_update_property (GTK_ACCESSIBLE (ssimg->image1),
+ GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, description,
+ -1);
+ gtk_accessible_update_property (GTK_ACCESSIBLE (ssimg->image2),
+ GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, description,
+ -1);
}
static void
@@ -678,19 +679,11 @@ gs_screenshot_image_dispose (GObject *object)
static void
gs_screenshot_image_init (GsScreenshotImage *ssimg)
{
- AtkObject *accessible;
-
ssimg->settings = g_settings_new ("org.gnome.software");
ssimg->showing_image = FALSE;
g_type_ensure (GS_TYPE_PICTURE);
gtk_widget_init_template (GTK_WIDGET (ssimg));
-
- accessible = gtk_widget_get_accessible (GTK_WIDGET (ssimg));
- if (accessible != 0) {
- atk_object_set_role (accessible, ATK_ROLE_IMAGE);
- atk_object_set_name (accessible, _("Screenshot"));
- }
}
static gboolean
@@ -724,6 +717,7 @@ gs_screenshot_image_class_init (GsScreenshotImageClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-screenshot-image.ui");
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_IMG);
gtk_widget_class_bind_template_child (widget_class, GsScreenshotImage, spinner);
gtk_widget_class_bind_template_child (widget_class, GsScreenshotImage, stack);
diff --git a/src/gs-screenshot-image.ui b/src/gs-screenshot-image.ui
index 07daca8c5..579e718f7 100644
--- a/src/gs-screenshot-image.ui
+++ b/src/gs-screenshot-image.ui
@@ -3,6 +3,9 @@
<!-- interface-requires gtk+ 3.10 -->
<template class="GsScreenshotImage" parent="GtkWidget">
<property name="visible">True</property>
+ <accessibility>
+ <property name="label" translatable="yes">Screenshot</property>
+ </accessibility>
<style>
<class name="screenshot-image"/>
</style>
diff --git a/src/gs-search-page.ui b/src/gs-search-page.ui
index 467ec24d5..4c3f4d517 100644
--- a/src/gs-search-page.ui
+++ b/src/gs-search-page.ui
@@ -2,11 +2,9 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GsSearchPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="search-accessible">
- <property name="accessible-name" translatable="yes">Search page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Search page</property>
+ </accessibility>
<child>
<object class="GtkStack" id="stack_search">
<property name="visible">True</property>
diff --git a/src/gs-shell.ui b/src/gs-shell.ui
index 55955fb9e..7fc0cd34c 100644
--- a/src/gs-shell.ui
+++ b/src/gs-shell.ui
@@ -163,11 +163,9 @@
<property name="can_focus">True</property>
<property name="active" bind-source="search_bar"
bind-property="search-mode-enabled" bind-flags="sync-create|bidirectional"/>
<signal name="clicked" handler="search_button_clicked_cb"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Search</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Search</property>
+ </accessibility>
<style>
<class name="image-button"/>
</style>
@@ -189,11 +187,9 @@
<property name="can_focus">True</property>
<property name="sensitive">True</property>
<property name="menu_model">primary_menu</property>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Primary
Menu</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Primary Menu</property>
+ </accessibility>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -369,11 +365,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="clicked" handler="gs_shell_back_button_cb"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Go back</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Go back</property>
+ </accessibility>
<style>
<class name="image-button"/>
</style>
@@ -457,11 +451,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="clicked" handler="gs_shell_details_back_button_cb"/>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Go back</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Go back</property>
+ </accessibility>
<style>
<class name="image-button"/>
</style>
diff --git a/src/gs-storage-context-dialog.ui b/src/gs-storage-context-dialog.ui
index 465f30f31..32cc83380 100644
--- a/src/gs-storage-context-dialog.ui
+++ b/src/gs-storage-context-dialog.ui
@@ -40,7 +40,7 @@
<property name="visible">True</property>
<property name="xalign">0.5</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
+ <relation name="labelled-by">title</relation>
</accessibility>
</object>
<packing>
@@ -64,9 +64,6 @@
<style>
<class name="title-1"/>
</style>
- <accessibility>
- <relation target="lozenge" type="label-for"/>
- </accessibility>
<style>
<class name="context-tile-title"/>
</style>
diff --git a/src/gs-summary-tile.c b/src/gs-summary-tile.c
index d2ebdcf24..667d7a903 100644
--- a/src/gs-summary-tile.c
+++ b/src/gs-summary-tile.c
@@ -39,7 +39,6 @@ gs_summary_tile_refresh (GsAppTile *self)
{
GsSummaryTile *tile = GS_SUMMARY_TILE (self);
GsApp *app = gs_app_tile_get_app (self);
- AtkObject *accessible;
g_autoptr(GIcon) icon = NULL;
gboolean installed;
g_autofree gchar *name = NULL;
@@ -64,8 +63,6 @@ gs_summary_tile_refresh (GsAppTile *self)
"system-component-application");
gtk_image_set_from_gicon (GTK_IMAGE (tile->image), icon);
- accessible = gtk_widget_get_accessible (GTK_WIDGET (tile));
-
switch (gs_app_get_state (app)) {
case GS_APP_STATE_INSTALLED:
case GS_APP_STATE_UPDATABLE:
@@ -94,9 +91,11 @@ gs_summary_tile_refresh (GsAppTile *self)
gtk_widget_set_visible (tile->eventbox, installed);
- if (GTK_IS_ACCESSIBLE (accessible) && name != NULL) {
- atk_object_set_name (accessible, name);
- atk_object_set_description (accessible, gs_app_get_summary (app));
+ if (name != NULL) {
+ gtk_accessible_update_property (GTK_ACCESSIBLE (tile),
+ GTK_ACCESSIBLE_PROPERTY_LABEL, name,
+ GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, gs_app_get_summary (app),
+ -1);
}
}
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index a6089150f..3bf52b863 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -1226,7 +1226,6 @@ gs_updates_page_setup (GsPage *page,
GError **error)
{
GsUpdatesPage *self = GS_UPDATES_PAGE (page);
- AtkObject *accessible;
GtkWidget *widget;
g_return_val_if_fail (GS_IS_UPDATES_PAGE (self), TRUE);
@@ -1301,9 +1300,9 @@ gs_updates_page_setup (GsPage *page,
/* setup update details window */
self->button_refresh = gtk_button_new_from_icon_name ("view-refresh-symbolic", GTK_ICON_SIZE_MENU);
- accessible = gtk_widget_get_accessible (self->button_refresh);
- if (accessible != NULL)
- atk_object_set_name (accessible, _("Check for updates"));
+ gtk_accessible_update_property (GTK_ACCESSIBLE (self->button_refresh),
+ GTK_ACCESSIBLE_PROPERTY_LABEL, _("Check for updates"),
+ -1);
gtk_box_prepend (GTK_BOX (self->header_start_box), self->button_refresh);
g_signal_connect (self->button_refresh, "clicked",
G_CALLBACK (gs_updates_page_button_refresh_cb),
diff --git a/src/gs-updates-page.ui b/src/gs-updates-page.ui
index d51c9e68b..f04686d98 100644
--- a/src/gs-updates-page.ui
+++ b/src/gs-updates-page.ui
@@ -2,11 +2,9 @@
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="GsUpdatesPage" parent="GsPage">
- <child internal-child="accessible">
- <object class="AtkObject" id="updates-accessible">
- <property name="accessible-name" translatable="yes">Updates page</property>
- </object>
- </child>
+ <accessibility>
+ <property name="label" translatable="yes">Updates page</property>
+ </accessibility>
<child>
<object class="GtkBox">
<property name="visible">True</property>
diff --git a/src/gs-updates-section.ui b/src/gs-updates-section.ui
index 2f3882160..70baff567 100644
--- a/src/gs-updates-section.ui
+++ b/src/gs-updates-section.ui
@@ -21,9 +21,6 @@
<style>
<class name="heading"/>
</style>
- <accessibility>
- <relation target="listbox_box" type="label-for"/>
- </accessibility>
</object>
</child>
<child>
@@ -93,7 +90,7 @@
<property name="orientation">vertical</property>
<property name="visible">True</property>
<accessibility>
- <relation target="title" type="labelled-by"/>
+ <relation name="labelled-by">title</relation>
</accessibility>
<child>
<object class="GtkListBox" id="listbox">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]