This commit is contained in:
Julian Daube 2020-12-02 15:26:29 +01:00
parent 4c8ca0246d
commit df7e947616
6 changed files with 168 additions and 0 deletions

3
gui/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/bin/python"
}

33
gui/app.spec Normal file
View File

@ -0,0 +1,33 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['app.py'],
pathex=['/home/julian/git/audioMux/gui'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='app',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False )

BIN
gui/dist/gui_linux vendored Executable file

Binary file not shown.

77
gui/icon.svg Normal file
View File

@ -0,0 +1,77 @@
<?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="10mm"
height="10mm"
viewBox="0 0 10 10"
version="1.1"
id="svg8"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="icon.svg"
inkscape:export-filename="/home/julian/git/audioMux/gui/icon/1.png"
inkscape:export-xdpi="325.12"
inkscape:export-ydpi="325.12">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="4.446261"
inkscape:cy="56.922155"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1918"
inkscape:window-height="1058"
inkscape:window-x="0"
inkscape:window-y="20"
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 />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Ebene 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-287)">
<circle
style="color:#000000;overflow:visible;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#298f29;stroke-width:0.9441849;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path815"
cx="5"
cy="292"
r="4.5279074" />
<text
xml:space="preserve"
style="font-size:4.23333311px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:#beb3b3;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
x="2.6935086"
y="294.57178"
id="text819"><tspan
sodipodi:role="line"
id="tspan817"
x="2.6935086"
y="294.57178"
style="font-size:7.05555534px;fill:#000000;fill-opacity:1;stroke:#beb3b3;stroke-width:0.26458332px;stroke-opacity:1;">1</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
gui/icon/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

55
gui/tray.py Normal file
View File

@ -0,0 +1,55 @@
import wx
from wx import adv
def create_menu_item(menu, label, func):
item = wx.MenuItem(menu, -1, label)
menu.Bind(wx.EVT_MENU, func, id=item.GetId())
menu.AppendItem(item)
return item
class Tray(wx.adv.TaskBarIcon):
def __init__(self, parent):
super().__init__()
self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.OnLeftDown)
self.SetIcon(wx.Icon("icon/1.png"))
self.parent = parent
def CreatePopupMenu(self):
menu = wx.Menu()
hidem = wx.MenuItem(menu, wx.ID_ANY, 'Show Window')
menu.Bind(wx.EVT_MENU, self.ShowParent, id=hidem.GetId())
menu.Append(hidem)
menu.AppendSeparator()
quitm = wx.MenuItem(menu, wx.ID_ANY, 'Quit')
menu.Bind(wx.EVT_MENU, self.OnExit, id=quitm.GetId())
menu.Append(quitm)
return menu
def CreateSelectionMenu(self):
return None
def OnLeftDown(self, event):
menu = self.CreateSelectionMenu()
if menu:
self.PopupMenu(menu)
def OnExit(self, event):
# close self and parent
wx.CallAfter(self.Destroy)
wx.CallAfter(self.parent.Destroy)
def ShowParent(self, evt):
self.parent.Show()
if __name__ == "__main__":
app = wx.App()
# create an empty frame to keep the main loop running
Tray(wx.Frame(None))
app.MainLoop()