Skip to content

Commit

Permalink
use the actual set_alternative_text method for Gtk.Picture
Browse files Browse the repository at this point in the history
  • Loading branch information
SoongNoonien committed Nov 3, 2024
1 parent d9deae2 commit 2b778d3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/plattenalbum.py
Original file line number Diff line number Diff line change
Expand Up @@ -1379,8 +1379,8 @@ def set_paintable(self, paintable):
self._picture.set_valign(Gtk.Align.FILL)
self._picture.set_paintable(paintable)

def set_alt_text(self, alt_text):
self._picture.update_property([Gtk.AccessibleProperty.LABEL], [alt_text])
def set_alternative_text(self, alt_text):
self._picture.set_alternative_text(alt_text)

###########
# browser #
Expand Down Expand Up @@ -1593,10 +1593,10 @@ def __init__(self, client):
def set_album(self, album):
if album.name:
self._title.set_text(album.name)
self._cover.set_alt_text(_("Album cover of {album}").format(album=album.name))
self._cover.set_alternative_text(_("Album cover of {album}").format(album=album.name))
else:
self._title.set_markup(f'<i>{GLib.markup_escape_text(_("Unknown Album"))}</i>')
self._cover.set_alt_text(_("Album cover of an unknown album"))
self._cover.set_alternative_text(_("Album cover of an unknown album"))
self._date.set_text(album.date)
if album.cover is None:
self._client.tagtypes("clear")
Expand Down Expand Up @@ -1721,11 +1721,11 @@ def __init__(self, client, albumartist, album, date, file=None):
if album:
self.set_title(album)
window_title.set_title(album)
album_cover.set_alt_text(_("Album cover of {album}").format(album=album))
album_cover.set_alternative_text(_("Album cover of {album}").format(album=album))
else:
self.set_title(_("Unknown Album"))
window_title.set_title(_("Unknown Album"))
album_cover.set_alt_text(_("Album cover of an unknown album"))
album_cover.set_alternative_text(_("Album cover of an unknown album"))
window_title.set_subtitle(" • ".join(filter(None, (date, str(Duration(client.count(*tag_filter)["playtime"]))))))
client.restrict_tagtypes("track", "title", "artist")
songs=client.find(*tag_filter)
Expand Down Expand Up @@ -2316,7 +2316,7 @@ def _display_lyrics(self, song):
class MainCover(Gtk.Picture):
def __init__(self, client):
super().__init__()
self.update_property([Gtk.AccessibleProperty.LABEL], [_("Current album cover")])
self.set_alternative_text(_("Current album cover"))
self._client=client

# connect
Expand Down

0 comments on commit 2b778d3

Please sign in to comment.