qt: use series of pngs for spinner
Use a series of .png frames for the spinner instead of a .mng. `mng` is an obscure image format and is not built by default into Qt5. This appears to improve the crispness of the spinner as well. Does not noticably increase the size (still ~27k) and the code is not more complicated either.
This commit is contained in:
BIN
share/qt/img/reload.png
Normal file
BIN
share/qt/img/reload.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
@@ -1,16 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
# W.J. van der Laan, 2011
|
||||
# Make spinning .mng animation from a .png
|
||||
# Make spinning animation from a .png
|
||||
# Requires imagemagick 6.7+
|
||||
from __future__ import division
|
||||
from os import path
|
||||
from PIL import Image
|
||||
from subprocess import Popen
|
||||
|
||||
SRC='img/reload_scaled.png'
|
||||
DST='../../src/qt/res/movies/update_spinner.mng'
|
||||
TMPDIR='/tmp'
|
||||
TMPNAME='tmp-%03i.png'
|
||||
SRC='img/reload.png'
|
||||
TMPDIR='../../src/qt/res/movies/'
|
||||
TMPNAME='spinner-%03i.png'
|
||||
NUMFRAMES=35
|
||||
FRAMERATE=10.0
|
||||
CONVERT='convert'
|
||||
@@ -36,8 +35,4 @@ for frame in xrange(NUMFRAMES):
|
||||
im_new.save(outfile, 'png')
|
||||
frame_files.append(outfile)
|
||||
|
||||
p = Popen([CONVERT, "-delay", str(FRAMERATE), "-dispose", "2"] + frame_files + [DST])
|
||||
p.communicate()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user