示例#1
0
 def _on_item_activated(self, flowbox, album_widget):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param album_widget as AlbumSimpleWidget
     """
     if FlowBoxView._on_item_activated(self, flowbox, album_widget):
         return
     if album_widget.artwork is None:
         return
     # If widget top not on screen, popover will fail to show
     # FIXME: Report a bug and check always true
     (x, y) = album_widget.translate_coordinates(self._scrolled, 0, 0)
     if y < 0:
         y = album_widget.translate_coordinates(self._box, 0, 0)[1]
         self._scrolled.get_allocation().height + y
         self._scrolled.get_vadjustment().set_value(y)
     from lollypop.pop_album import AlbumPopover
     popover = AlbumPopover(album_widget.album, ArtSize.NONE)
     popover.set_relative_to(album_widget.artwork)
     popover.set_position(Gtk.PositionType.BOTTOM)
     album_widget.show_overlay(False)
     album_widget.lock_overlay(True)
     popover.connect("closed", self.__on_album_popover_closed, album_widget)
     popover.popup()
     album_widget.artwork.set_opacity(0.9)
 def _on_item_activated(self, flowbox, widget):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param widget as PlaylistRoundedWidget
     """
     if not self._view_type & ViewType.SMALL and\
             FlowBoxView._on_item_activated(self, flowbox, widget):
         return
     App().window.emit("show-can-go-back", True)
     App().window.emit("can-go-back-changed", True)
     App().window.container.show_view([Type.GENRES], widget.data)
示例#3
0
 def _on_item_activated(self, flowbox, album_widget):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param album_widget as AlbumSimpleWidget
     """
     if not self._view_type & ViewType.SMALL and\
             FlowBoxView._on_item_activated(self, flowbox, album_widget):
         return
     if album_widget.artwork is None:
         return
     album = Album(album_widget.album.id, self.__genre_ids,
                   self.__artist_ids)
     App().window.container.show_view([Type.ALBUM], album)
示例#4
0
 def _on_item_activated(self, flowbox, widget):
     """
         Show Context view for activated album
         @param flowbox as Gtk.Flowbox
         @param widget as AlbumsDecadeWidget
     """
     if not self._view_type & ViewType.SMALL and\
             FlowBoxView._on_item_activated(self, flowbox, widget):
         return
     show_sidebar = App().settings.get_value("show-sidebar")
     sidebar_content = App().settings.get_enum("sidebar-content")
     show_genres = sidebar_content == SidebarContent.GENRES
     if not show_genres:
         App().window.emit("show-can-go-back", True)
         App().window.emit("can-go-back-changed", True)
     if show_sidebar and show_genres and not App().window.is_adaptive:
         App().window.container.list_two.select_ids(widget.data)
     else:
         App().window.container.show_view([Type.YEARS], widget.data)