コード例 #1
0
    def __init__(self, icons, layout, show_ratings, overlay_icon_name):
        GObject.GObject.__init__(self)

        # geometry-state values
        self.pixbuf_width = 0
        self.apptitle_width = 0
        self.apptitle_height = 0
        self.normal_height = 0
        self.selected_height = 0
        self.show_ratings = show_ratings

        # button packing
        self.button_spacing = 0
        self._buttons = {Gtk.PackType.START: [], Gtk.PackType.END: []}
        self._all_buttons = {}

        # cache a layout
        self._layout = layout
        # star painter, paints stars
        self._stars = StarRenderer()
        self._stars.size = StarSize.SMALL

        # icon/overlay jazz
        try:
            self._installed = icons.load_icon(overlay_icon_name,
                                              self.OVERLAY_SIZE, 0)
        except GObject.GError:
            # icon not present in theme, probably because running uninstalled
            self._installed = icons.load_icon('emblem-system',
                                              self.OVERLAY_SIZE, 0)
        return