Skip to content

Commit

Permalink
Merge pull request #341 from exaile/a11y-progressbar
Browse files Browse the repository at this point in the history
Playback: set Atk role for progressbar to AUDIO
  • Loading branch information
virtuald committed Apr 28, 2017
2 parents 609db72 + 03245ed commit 5163d99
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions xlgui/widgets/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

from gi.repository import Atk
from gi.repository import Gdk
from gi.repository import GLib
from gi.repository import GObject
Expand All @@ -43,6 +44,10 @@

from xlgui.guiutil import GtkTemplate

import logging
logger = logging.getLogger(__name__)


class ProgressBarFormatter(formatter.ProgressTextFormatter):
"""
A formatter for progress bars
Expand Down Expand Up @@ -70,6 +75,12 @@ class PlaybackProgressBar(Gtk.ProgressBar):
def __init__(self, player):
Gtk.ProgressBar.__init__(self)
self.__player = player

try:
awidget = self.get_accessible()
awidget.set_role(Atk.Role.AUDIO)
except Exception:
logger.debug("Exception setting ATK role", exc_info=True)

self.set_show_text(True)

Expand Down

0 comments on commit 5163d99

Please sign in to comment.