Exemplo n.º 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)