Merge pull request #13 from seird/macos-icons
Match macos icons to os design
@@ -4,6 +4,8 @@ import platform
|
|||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
|
logo = "gotify_tray/gui/images/logo.ico" if platform.system() != "Darwin" else "gotify_tray/gui/images/logo-macos.ico"
|
||||||
|
|
||||||
a = Analysis(['gotify_tray/__main__.py'],
|
a = Analysis(['gotify_tray/__main__.py'],
|
||||||
pathex=[os.getcwd()],
|
pathex=[os.getcwd()],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
@@ -29,7 +31,7 @@ exe = EXE(pyz,
|
|||||||
upx=True,
|
upx=True,
|
||||||
console=False,
|
console=False,
|
||||||
version='version.py',
|
version='version.py',
|
||||||
icon='logo.ico')
|
icon=logo)
|
||||||
coll = COLLECT(exe,
|
coll = COLLECT(exe,
|
||||||
a.binaries,
|
a.binaries,
|
||||||
a.zipfiles,
|
a.zipfiles,
|
||||||
@@ -41,5 +43,5 @@ coll = COLLECT(exe,
|
|||||||
if platform.system() == "Darwin":
|
if platform.system() == "Darwin":
|
||||||
app = BUNDLE(coll,
|
app = BUNDLE(coll,
|
||||||
name='Gotify Tray.app',
|
name='Gotify Tray.app',
|
||||||
icon='logo.ico',
|
icon=logo,
|
||||||
bundle_identifier=None)
|
bundle_identifier=None)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from gotify_tray.tasks import (
|
|||||||
GetMessagesTask,
|
GetMessagesTask,
|
||||||
ServerConnectionWatchdogTask,
|
ServerConnectionWatchdogTask,
|
||||||
)
|
)
|
||||||
from gotify_tray.utils import get_abs_path, verify_server
|
from gotify_tray.utils import get_icon, verify_server
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
from ..__version__ import __title__
|
from ..__version__ import __title__
|
||||||
@@ -410,9 +410,7 @@ def start_gui():
|
|||||||
app = MainApplication(sys.argv)
|
app = MainApplication(sys.argv)
|
||||||
app.setApplicationName(title)
|
app.setApplicationName(title)
|
||||||
app.setQuitOnLastWindowClosed(False)
|
app.setQuitOnLastWindowClosed(False)
|
||||||
app.setWindowIcon(
|
app.setWindowIcon(QtGui.QIcon(get_icon("gotify-small")))
|
||||||
QtGui.QIcon(get_abs_path("gotify_tray/gui/images/gotify-small.png"))
|
|
||||||
)
|
|
||||||
app.setStyle("fusion")
|
app.setStyle("fusion")
|
||||||
|
|
||||||
init_logger(logger)
|
init_logger(logger)
|
||||||
|
|||||||
BIN
gotify_tray/gui/images/gotify-small-macos.png
Normal file
|
After Width: | Height: | Size: 339 KiB |
BIN
gotify_tray/gui/images/logo-macos.ico
Normal file
|
After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
BIN
gotify_tray/gui/images/tray-error-macos.png
Normal file
|
After Width: | Height: | Size: 332 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
BIN
gotify_tray/gui/images/tray-macos.png
Normal file
|
After Width: | Height: | Size: 334 KiB |
BIN
gotify_tray/gui/images/tray.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
@@ -2,7 +2,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt6 import QtGui, QtWidgets
|
from PyQt6 import QtGui, QtWidgets
|
||||||
from gotify_tray.__version__ import __title__
|
from gotify_tray.__version__ import __title__
|
||||||
from gotify_tray.utils import get_abs_path
|
from gotify_tray.utils import get_icon
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("gotify-tray")
|
logger = logging.getLogger("gotify-tray")
|
||||||
@@ -44,7 +44,7 @@ class Tray(QtWidgets.QSystemTrayIcon):
|
|||||||
self.setContextMenu(menu)
|
self.setContextMenu(menu)
|
||||||
|
|
||||||
def set_icon_ok(self):
|
def set_icon_ok(self):
|
||||||
self.setIcon(QtGui.QIcon(get_abs_path("gotify_tray/gui/images/gotify-small.png")))
|
self.setIcon(QtGui.QIcon(get_icon("tray")))
|
||||||
|
|
||||||
def set_icon_error(self):
|
def set_icon_error(self):
|
||||||
self.setIcon(QtGui.QIcon(get_abs_path("gotify_tray/gui/images/gotify-small-error.png")))
|
self.setIcon(QtGui.QIcon(get_icon("tray-error")))
|
||||||
|
|||||||
@@ -57,3 +57,10 @@ def open_file(filename: str):
|
|||||||
os.startfile(filename)
|
os.startfile(filename)
|
||||||
elif platform.system() == "Darwin":
|
elif platform.system() == "Darwin":
|
||||||
subprocess.call(["open", filename])
|
subprocess.call(["open", filename])
|
||||||
|
|
||||||
|
|
||||||
|
def get_icon(name: str) -> str:
|
||||||
|
if platform.system() == "Darwin":
|
||||||
|
name += "-macos"
|
||||||
|
|
||||||
|
return get_abs_path(f"gotify_tray/gui/images/{name}.png")
|
||||||
|
|||||||