diff --git a/ks_includes/KlippyGtk.py b/ks_includes/KlippyGtk.py index 34f9f483..6a0037c5 100644 --- a/ks_includes/KlippyGtk.py +++ b/ks_includes/KlippyGtk.py @@ -70,7 +70,7 @@ class KlippyGtk: def Image(self, image_name, style=False, width_scale=1, height_scale=1): pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( - "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name)), + "%s/styles/z-bolt/images/%s" % (klipperscreendir, str(image_name)), int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True) return Gtk.Image.new_from_pixbuf(pixbuf) diff --git a/panels/print.py b/panels/print.py index ed30c225..5188d4e2 100644 --- a/panels/print.py +++ b/panels/print.py @@ -83,7 +83,7 @@ class PrintPanel(ScreenPanel): file.set_hexpand(True) file.set_vexpand(False) - icon = self._gtk.Image("file", False, 1.6, 1.6) + icon = self._gtk.Image("file.svg", False, 1.6, 1.6) pixbuf = self.get_file_image(filename) if pixbuf != None: icon.set_from_pixbuf(pixbuf) @@ -107,18 +107,6 @@ class PrintPanel(ScreenPanel): self.labels['filelist'].attach(self.files[filename], 0, pos, 1, 1) self.labels['filelist'].show_all() - def get_file_image(self, filename, width=1.6, height=1.6): - fileinfo = self._screen.files.get_file_info(filename) - if fileinfo == None: - return None - - if "thumbnails" in fileinfo and len(fileinfo["thumbnails"]) > 0: - thumbnail = fileinfo['thumbnails'][0] - return self._gtk.PixbufFromFile("/tmp/.KS-thumbnails/%s-%s" % (fileinfo['filename'], thumbnail['size']), - None, width, height) - return None - - def get_file_info_str(self, filename): _ = self.lang.gettext diff --git a/panels/splash_screen.py b/panels/splash_screen.py index c71f5cc6..b24eb62c 100644 --- a/panels/splash_screen.py +++ b/panels/splash_screen.py @@ -18,9 +18,7 @@ class SplashScreenPanel(ScreenPanel): def initialize(self, panel_name): _ = self.lang.gettext - image = Gtk.Image() - #TODO: update file reference - image.set_from_file(os.getcwd() + "/styles/z-bolt/images/klipper.png") + image = self._gtk.Image("klipper.png", None, 4, 3) self.labels['text'] = Gtk.Label(_("Initializing printer...")) self.labels['text'].set_line_wrap(True)