develop #1
@ -56,7 +56,12 @@ class Icon(DesktopIconMixin, VideoIconMixin):
|
||||
|
||||
def create_scaled_image(self, path, wxh):
|
||||
try:
|
||||
return GdkPixbuf.Pixbuf.new_from_file_at_scale(path, wxh[0], wxh[1], True)
|
||||
if path.lower().endswith(".gif"):
|
||||
return GdkPixbuf.PixbufAnimation.new_from_file(path) \
|
||||
.get_static_image() \
|
||||
.scale_simple(wxh[0], wxh[1], GdkPixbuf.InterpType.BILINEAR)
|
||||
else:
|
||||
return GdkPixbuf.Pixbuf.new_from_file_at_scale(path, wxh[0], wxh[1], True)
|
||||
except Exception as e:
|
||||
print("Image Scaling Issue:")
|
||||
print( repr(e) )
|
||||
|
@ -115,7 +115,7 @@ class WidgetMixin:
|
||||
def create_grid_iconview_widget(self, view, wid):
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
grid = Gtk.IconView()
|
||||
store = Gtk.ListStore(GdkPixbuf.Pixbuf or None, str)
|
||||
store = Gtk.ListStore(GdkPixbuf.Pixbuf or GdkPixbuf.PixbufAnimation or None, str)
|
||||
|
||||
grid.set_model(store)
|
||||
grid.set_pixbuf_column(0)
|
||||
@ -156,7 +156,7 @@ class WidgetMixin:
|
||||
def create_grid_treeview_widget(self, view, wid):
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
grid = Gtk.TreeView()
|
||||
store = Gtk.ListStore(GdkPixbuf.Pixbuf or None, str)
|
||||
store = Gtk.ListStore(GdkPixbuf.Pixbuf or GdkPixbuf.PixbufAnimation or None, str)
|
||||
# store = Gtk.TreeStore(GdkPixbuf.Pixbuf or None, str)
|
||||
column = Gtk.TreeViewColumn("Icons")
|
||||
icon = Gtk.CellRendererPixbuf()
|
||||
|
Loading…
Reference in New Issue
Block a user