[gnome-music/wip/jfelder/new-artist-design: 23/26] albumwidget: Add optional size groups
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/new-artist-design: 23/26] albumwidget: Add optional size groups
- Date: Thu, 5 Aug 2021 19:32:36 +0000 (UTC)
commit abf8384d32edf47ea8a7deaf2453fc96586e699c
Author: Jean Felder <jfelder src gnome org>
Date: Fri Jul 30 18:39:40 2021 +0200
albumwidget: Add optional size groups
This allows to have similar sizes for the album cover and the list of
songs when various AlbumWidget are inserted in the same view.
This will be used by ArtistAlbumsWidget in a future commit.
gnomemusic/widgets/albumwidget.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index d1f6056ae..5a1e9dc0d 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -63,10 +63,15 @@ class AlbumWidget(Gtk.Box):
selection_mode = GObject.Property(type=bool, default=False)
show_artist_label = GObject.Property(type=bool, default=True)
- def __init__(self, application: Application) -> None:
+ def __init__(
+ self, application: Application,
+ size_group: Optional[Gtk.SizeGroup] = None,
+ cover_size_group: Optional[Gtk.SizeGroup] = None) -> None:
"""Initialize the AlbumWidget.
:param GtkApplication application: The application object
+ :param GtkSizeGroup size_group: SizeGroup for the discs
+ :param GtkSizeGroup cover_size_group: SizeGroup for the cover
"""
super().__init__()
@@ -77,6 +82,9 @@ class AlbumWidget(Gtk.Box):
self._year_signal_id = 0
self._model_signal_id = 0
+ self._size_group = size_group
+ self._cover_size_group = cover_size_group
+
self._art_stack.props.size = ArtSize.LARGE
self._player = self._application.props.player
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]