Ejemplo n.º 1
0
 def __init__(self, storage_type, view_type):
     """
         Init view
         @param view_type as ViewType
         @param storage_type as StorageType
     """
     AlbumsBoxView.__init__(self, [], [], storage_type, view_type)
     self.set_property("valign", Gtk.Align.START)
     self._label = Gtk.Label.new()
     self._label.set_ellipsize(Pango.EllipsizeMode.END)
     self._label.set_hexpand(True)
     self._label.set_property("halign", Gtk.Align.START)
     self._label.get_style_context().add_class("dim-label")
     self.__update_label(App().window.folded)
     self._backward_button = Gtk.Button.new_from_icon_name(
                                                     "go-previous-symbolic",
                                                     Gtk.IconSize.BUTTON)
     self._forward_button = Gtk.Button.new_from_icon_name(
                                                    "go-next-symbolic",
                                                    Gtk.IconSize.BUTTON)
     self._backward_button.get_style_context().add_class("menu-button")
     self._forward_button.get_style_context().add_class("menu-button")
     header = Gtk.Grid()
     header.set_column_spacing(10)
     header.add(self._label)
     header.add(self._backward_button)
     header.add(self._forward_button)
     header.set_margin_end(MARGIN)
     header.show_all()
     HorizontalScrollingHelper.__init__(self)
     self.add(header)
     self.add_widget(self._box)
Ejemplo n.º 2
0
 def __init__(self, genre_ids, artist_ids, storage_type, view_type):
     """
         Init ArtistView
         @param genre_ids as [int]
         @param artist_ids as [int]
         @param storage_type as StorageType
         @param view_type as ViewType
     """
     AlbumsBoxView.__init__(self, genre_ids, artist_ids, storage_type,
                            view_type | ViewType.OVERLAY | ViewType.ARTIST)
     self.__others_boxes = []
     self.__banner = ArtistBannerWidget(genre_ids, artist_ids,
                                        self._storage_type, view_type)
     self.__banner.show()
     self._box.get_style_context().add_class("padding")
     self.connect("populated", self.__on_populated)
     self.__grid = Gtk.Grid()
     self.__grid.show()
     self.__grid.set_property("valign", Gtk.Align.START)
     self.__grid.set_row_spacing(10)
     self.__grid.set_orientation(Gtk.Orientation.VERTICAL)
     self.__grid.add(self._box)
     self.add_widget(self.__grid, self.__banner)