Example #1
0
 def _on_image_button_release_event(self, widget, event):
     """
         Change artwork type
         @param widget as Gtk.Widget
         @param event as Gdk.Event
     """
     fs_type = App().settings.get_value("fullscreen-type").get_int32()
     if fs_type & ArtBehaviour.BLUR_HARD and\
             fs_type & ArtBehaviour.ROUNDED:
         fs_type = ArtBehaviour.NONE
     elif fs_type & ArtBehaviour.NONE:
         fs_type = ArtBehaviour.BLUR_HARD
     elif fs_type & ArtBehaviour.BLUR_HARD:
         fs_type |= ArtBehaviour.ROUNDED
         fs_type &= ~ArtBehaviour.BLUR_HARD
     elif fs_type & ArtBehaviour.ROUNDED:
         fs_type |= ArtBehaviour.BLUR_HARD
     else:
         fs_type = ArtBehaviour.NONE
     App().settings.set_value("fullscreen-type",
                              GLib.Variant("i", fs_type))
     self.__setup_controller()
     self.__update_background()
     InformationController.on_current_changed(self,
                                              self.__art_size,
                                              self.__font_size)
 def on_current_changed(self, player):
     """
         Update widgets
         player as Player
     """
     if self.get_realized():
         InformationController.on_current_changed(self, self.art_size, None)
Example #3
0
 def update_cover(self, width):
     """
         Update cover for width
         @param width as int
     """
     self.__width = width
     InformationController.on_current_changed(self, width, None)
Example #4
0
 def __on_current_changed(self, player):
     """
         Update controllers
         @param player as Player
     """
     if App().player.current_track.id is not None:
         self.show()
     InformationController.on_current_changed(self, self.__width, None)
     ProgressController.on_current_changed(self, player)
Example #5
0
 def __on_current_changed(self, player):
     """
         Update controllers
         @param player as Player
     """
     if App().player.current_track.id is not None:
         self.show()
     InformationController.on_current_changed(self, self.__size, None)
     ProgressController.on_current_changed(self, player)
     PlaybackController.on_current_changed(self, player)
     if self.__cover is not None:
         self.__update_artwork()
Example #6
0
 def __on_size_allocate(self, widget, allocation):
     """
         Update cover based on current height
         @param widget as Gtk.Widget
         @param allocation as Gdk.Rectangle
     """
     if self.__height == allocation.height:
         return
     self.__height = allocation.height
     if self.__height == widget.get_preferred_height()[0]:
         InformationController.__init__(self, True, ArtHelperEffect.BLUR)
     else:
         InformationController.__init__(self, True, ArtHelperEffect.NONE)
     InformationController.on_current_changed(self, self.__width, None)
Example #7
0
 def on_current_changed(self, player):
     """
         Update controllers
         @param player as Player
     """
     InformationController.on_current_changed(self, self.__artsize,
                                              self.__font_size)
     ProgressController.on_current_changed(self, player)
     if player.current_track.id is not None:
         album_name = player.current_track.album.name
         if player.current_track.year:
             album_name += " (%s)" % player.current_track.year
         self._album_label.set_markup(
             "<span font='%s'>%s</span>" %
             (self.__font_size - 1, GLib.markup_escape_text(album_name)))
Example #8
0
 def __handle_size_allocate(self, allocation):
     """
         Change box max/min children
         @param allocation as Gtk.Allocation
     """
     self.__allocation_timeout_id = None
     # We use parent height because we may be collapsed
     parent = self.get_parent()
     if parent is None:
         height = allocation.height
     else:
         height = parent.get_allocated_height()
     new_size = max(allocation.width, height)
     if new_size == 1 or self.__size == new_size:
         return
     self.__size = new_size
     self._previous_artwork_id = None
     InformationController.on_current_changed(self, new_size, None)
Example #9
0
 def _on_image_button_release_event(self, widget, event):
     """
         Change artwork type
         @param widget as Gtk.Widget
         @param event as Gdk.Event
     """
     rotate_album = not App().settings.get_value("rotate-fullscreen-album")
     App().settings.set_value("rotate-fullscreen-album",
                              GLib.Variant("b", rotate_album))
     context = self._artwork.get_style_context()
     if rotate_album:
         context.add_class("image-rotate")
         context.remove_class("cover-frame")
         InformationController.__init__(self, False,
                                        ArtHelperEffect.ROUNDED)
     else:
         context.remove_class("image-rotate")
         context.add_class("cover-frame")
         InformationController.__init__(self, False, ArtHelperEffect.NONE)
     InformationController.on_current_changed(self, self.__artsize,
                                              self.__font_size)