Browse Source

added a window-icon

master
Stefan Naumann 4 years ago
parent
commit
04025f50a5
  1. 69
      pic/logo.svg
  2. BIN
      pic/logo64.data
  3. 21
      src/ui.py

69
pic/logo.svg

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="256"
height="256"
viewBox="0 0 67.733332 67.733335"
version="1.1"
id="svg8"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
sodipodi:docname="logo.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="255.67615"
inkscape:cy="84.965157"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1032"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-229.26665)">
<path
style="stroke-width:0.86362928"
d="M 5 60 L 5 196 L 251 196 L 251 60 L 239.93945 60 A 9.9999993 9.9999993 0 0 1 240 61 A 9.9999993 9.9999993 0 0 1 230 71 A 9.9999993 9.9999993 0 0 1 220 61 A 9.9999993 9.9999993 0 0 1 220.05078 60 L 34.939453 60 A 9.9999988 9.9999988 0 0 1 35 61 A 9.9999988 9.9999988 0 0 1 25 71 A 9.9999988 9.9999988 0 0 1 15 61 A 9.9999988 9.9999988 0 0 1 15.050781 60 L 5 60 z M 25 81 A 9.9999989 9.9999989 0 0 1 35 91 A 9.9999989 9.9999989 0 0 1 25 101 A 9.9999989 9.9999989 0 0 1 15 91 A 9.9999989 9.9999989 0 0 1 25 81 z M 230 81 A 9.9999994 9.9999994 0 0 1 240 91 A 9.9999994 9.9999994 0 0 1 230 101 A 9.9999994 9.9999994 0 0 1 220 91 A 9.9999994 9.9999994 0 0 1 230 81 z M 25 111 A 9.999999 9.999999 0 0 1 35 121 A 9.999999 9.999999 0 0 1 25 131 A 9.999999 9.999999 0 0 1 15 121 A 9.999999 9.999999 0 0 1 25 111 z M 230 111 A 9.9999995 9.9999995 0 0 1 240 121 A 9.9999995 9.9999995 0 0 1 230 131 A 9.9999995 9.9999995 0 0 1 220 121 A 9.9999995 9.9999995 0 0 1 230 111 z M 25 141 A 9.9999991 9.9999991 0 0 1 35 151 A 9.9999991 9.9999991 0 0 1 25 161 A 9.9999991 9.9999991 0 0 1 15 151 A 9.9999991 9.9999991 0 0 1 25 141 z M 230 141 A 9.9999996 9.9999996 0 0 1 240 151 A 9.9999996 9.9999996 0 0 1 230 161 A 9.9999996 9.9999996 0 0 1 220 151 A 9.9999996 9.9999996 0 0 1 230 141 z M 25 171 A 9.9999992 9.9999992 0 0 1 35 181 A 9.9999992 9.9999992 0 0 1 25 191 A 9.9999992 9.9999992 0 0 1 15 181 A 9.9999992 9.9999992 0 0 1 25 171 z M 230 171 A 9.9999997 9.9999997 0 0 1 240 181 A 9.9999997 9.9999997 0 0 1 230 191 A 9.9999997 9.9999997 0 0 1 220 181 A 9.9999997 9.9999997 0 0 1 230 171 z "
transform="matrix(0.26458333,0,0,0.26458333,0,229.26665)"
id="rect3699" />
<path
style="fill:#ffffff;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 21.166667,250.43332 v 25.4 l 25.4,-12.7"
id="path3848"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
pic/logo64.data

Binary file not shown.

21
src/ui.py

@ -9,6 +9,7 @@ import config
import piplayer
import playlist
import re
import os
btnSize = 40;
@ -391,13 +392,31 @@ def init ( cfg, media ):
pl.addUrls ( media );
pl.length ();
pl.debug();
window = Fl_Window( cfg.get("WindowX", 100) , cfg.get("WindowY", 100), cfg.get("WindowWidth", 640), cfg.get("WindowHeight", 480))
window.label("PiPlayer")
window.size_range ( 320, 240, 0, 0);
window.color ( 0x272828ff );
try:
icon = [];
sizes = [64];
i=0;
if (hasattr(sys, "frozen")):
module_path = os.path.dirname(os.path.dirname(sys.executable));
else:
module_path = os.path.dirname(os.path.dirname(__file__));
while ( i < len(sizes) ) :
ifile = open ( module_path + "/pic/logo"+str(sizes[i])+".data", "rb");
b=ifile.read();
icon.append( Fl_RGB_Image( b, sizes[i], sizes[i], 4, 0 ) )
i=i+1;
window.icon ( icon[0] );
except:
pass
print (icon);
w = window.w();
h = window.h();