Beispiel #1
0
    def get_pixbuf(self, icon_size):
        """
        Returns an icon in pixbuf format with dimension @icon_size

        Subclasses should implement: get_gicon and get_icon_name,
        if they make sense.
        The methods are tried in that order.
        """
        gicon = self.get_gicon()
        pbuf = gicon and icons.get_icon_for_gicon(gicon, icon_size)
        if pbuf:
            return pbuf
        icon_name = self.get_icon_name()
        icon = icon_name and icons.get_icon_for_name(icon_name, icon_size)
        if icon:
            return icon
        return icons.get_icon_for_name(self.fallback_icon_name, icon_size)
Beispiel #2
0
    def get_pixbuf(self, icon_size):
        """
		Returns an icon in pixbuf format with dimension @icon_size

		Subclasses should implement: get_gicon and get_icon_name,
		if they make sense.
		The methods are tried in that order.
		"""
        gicon = self.get_gicon()
        pbuf = gicon and icons.get_icon_for_gicon(gicon, icon_size)
        if pbuf:
            return pbuf
        icon_name = self.get_icon_name()
        icon = icon_name and icons.get_icon_for_name(icon_name, icon_size)
        if icon:
            return icon
        return icons.get_icon_for_name(self.fallback_icon_name, icon_size)
Beispiel #3
0
	def get_nomatch_name_icon(self, empty):
		get_pbuf = \
			lambda m: (m.get_thumbnail(self.icon_size*4/3, self.icon_size) or \
					m.get_pixbuf(self.icon_size))
		if empty and self.source:
			return (_("%s is empty") %
					escape_markup_str(unicode(self.source)),
					get_pbuf(self.source))
		elif self.source:
			return (_('No matches in %(src)s for "%(query)s"') % {
				"src": u"<i>%s</i>" % escape_markup_str(unicode(self.source)),
				"query": escape_markup_str(self.text),
				},
				get_pbuf(self.source))
		else:
			return _("No matches"), icons.get_icon_for_name("kupfer-object",
					self.icon_size)
Beispiel #4
0
	def get_nomatch_name_icon(self, empty=False):
		return _("No action"), icons.get_icon_for_name("gtk-execute",
				self.icon_size)