2020-08-02 17:18:28 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import gi
|
2024-05-26 18:29:10 +02:00
|
|
|
|
2023-01-08 18:20:30 +01:00
|
|
|
gi.require_version('Gtk', '4.0')
|
|
|
|
gi.require_version('Adw', '1')
|
|
|
|
from gi.repository import Gtk, GObject, Adw
|
2020-08-02 17:18:28 +02:00
|
|
|
|
|
|
|
|
2020-08-09 11:09:53 +02:00
|
|
|
@Gtk.Template(resource_path='/xyz/suruatoel/mcg/ui/album-headerbar.ui')
|
2023-01-08 18:20:30 +01:00
|
|
|
class AlbumHeaderbar(Adw.Bin):
|
2020-08-02 17:18:28 +02:00
|
|
|
__gtype_name__ = 'McgAlbumHeaderbar'
|
2024-05-27 12:46:46 +02:00
|
|
|
__gsignals__ = {'close': (GObject.SIGNAL_RUN_FIRST, None, ())}
|
2020-08-02 17:18:28 +02:00
|
|
|
|
|
|
|
# Widgets
|
|
|
|
standalone_title = Gtk.Template.Child()
|
|
|
|
standalone_artist = Gtk.Template.Child()
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__()
|
|
|
|
|
|
|
|
@Gtk.Template.Callback()
|
|
|
|
def on_close_clicked(self, widget):
|
|
|
|
self.emit('close')
|
|
|
|
|
|
|
|
def set_album(self, album):
|
|
|
|
self.standalone_title.set_text(album.get_title())
|
|
|
|
self.standalone_artist.set_text(", ".join(album.get_albumartists()))
|