def _on_destroy(self, widget): """ Destroyed widget @param widget as Gtk.Widget """ Row._on_destroy(self, widget) DNDRow._on_destroy(self, widget) self.__artwork = None
def _on_destroy(self, widget): """ Destroyed widget @param widget as Gtk.Widget """ Row._on_destroy(self, widget) if self._list_type & RowListType.DND: DNDRow._on_destroy(self, widget)
def set_previous_row(self, row): """ Set previous row @param row as Row """ if self._view_type & ViewType.DND: Row.set_previous_row(self, row) self.update_artwork_state()
def _on_destroy(self, widget): """ Destroyed widget @param widget as Gtk.Widget """ Row._on_destroy(self, widget) if self._view_type & ViewType.DND: DNDRow._on_destroy(self, widget) self.__artwork = None
def __init__(self, track, list_type): """ Init row widget @param track as Track @param list_type as RowListType """ Row.__init__(self, track, list_type) if list_type & RowListType.DND: DNDRow.__init__(self) self.__filtered = False self._grid.insert_row(0) self._grid.insert_column(0) self._grid.insert_column(1) self._grid.attach(self._indicator, 1, 1, 1, 2) self.__artwork = App().art_helper.get_image(ArtSize.MEDIUM, ArtSize.MEDIUM, "small-cover-frame") self.__artwork.set_no_show_all(True) self.__artwork.set_margin_top(2) self.__artwork.set_margin_start(2) self.__artwork.set_margin_bottom(2) # We force width with a Box box = Gtk.Box() box.set_homogeneous(True) box.add(self.__artwork) box.set_property("width-request", ArtSize.MEDIUM + 2) self._grid.attach(box, 0, 0, 1, 2) self.show_all() self.__header = Gtk.Grid() self.__header.set_column_spacing(5) if self._track.album.artist_ids[0] != Type.COMPILATIONS: self.__album_artist_label = Gtk.Label() self.__album_artist_label.set_markup( "<b>" + GLib.markup_escape_text(", ".join(self._track.album.artists)) + "</b>") self.__album_artist_label.set_ellipsize(Pango.EllipsizeMode.END) self.__album_artist_label.get_style_context().add_class( "dim-label") self.__header.add(self.__album_artist_label) self.__album_label = Gtk.Label.new(self._track.album.name) self.__album_label.set_ellipsize(Pango.EllipsizeMode.END) self.__album_label.get_style_context().add_class("dim-label") self.__album_label.set_hexpand(True) self.__album_label.set_property("halign", Gtk.Align.END) self.__header.add(self.__album_label) if self._artists_label is not None: self._grid.attach(self.__header, 1, 0, 5, 1) else: self._grid.attach(self.__header, 1, 0, 4, 1) self.set_indicator(App().player.current_track.id == self._track.id, self._track.loved)
def __init__(self, track, list_type): """ Init row widget and show it @param track as Track @param list_type as RowListType """ Row.__init__(self, track, list_type) self.__filtered = False self._grid.insert_column(0) self._grid.attach(self._indicator, 0, 0, 1, 1) self.show_all() if list_type & RowListType.DND: DNDRow.__init__(self)
def __init__(self, track, album_artist_ids, view_type): """ Init row widget and show it @param track as Track @pram album_artist_ids as [int] @param view_type as ViewType """ Row.__init__(self, track, album_artist_ids, view_type) self._grid.insert_column(0) self._grid.attach(self._indicator, 0, 0, 1, 1) self.show_all() if view_type & ViewType.DND: DNDRow.__init__(self)