splash_screen: Update klipper logo to scale for lower resolutions
This commit is contained in:
parent
5408aec036
commit
36c9b42970
@ -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)
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user