Exemple #1
0
 def _render_prefs_icon(self):
     scale_factor = get_monitor_scale_factor()
     prefs_pixbuf = load_image(get_data_file('media', 'gear.svg'),
                               16 * scale_factor)
     surface = Gdk.cairo_surface_create_from_pixbuf(prefs_pixbuf,
                                                    scale_factor,
                                                    self.get_window())
     prefs_image = Gtk.Image.new_from_surface(surface)
     self.prefs_btn.set_image(prefs_image)
    def get_icon(self):
        if isinstance(self._icon, str):
            icon_path = self._icon

            if not icon_path.startswith('/'):
                icon_path = os.path.join(self.extension_path, icon_path)

            return load_image(icon_path, self.get_icon_size())

        # assuming it's GtkPixbuf
        return self._icon
Exemple #3
0
 def load_icon(self, size, icon=None):
     return load_image(self.get_icon_path(icon), size)
    def get_icon(self):
        if self.icon:
            return load_image(self.icon, self.get_icon_size())

        return load_image(get_data_file('media', 'executable-icon.png'),
                          self.get_icon_size())
 def load_icon(self, size):
     return load_image(self.get_icon_path(), size)
Exemple #6
0
 def get_icon(self):
     return load_image(get_data_file('media/calculator-icon.png'),
                       self.ICON_SIZE)
 def get_icon(self):
     return load_image(get_data_file('media/calculator-icon.png'),
                       self.get_icon_size())