Skip to content

Commit

Permalink
从新的位置加载托盘图标
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 29, 2023
1 parent 5071335 commit 860cfcd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion webview_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from tkinter import messagebox
from time import sleep
import sys
import pathlib


quit_app = False
Expand Down Expand Up @@ -88,7 +89,15 @@ def is_port_in_use(port):
width = conf["webview"]["width"]
height = conf["webview"]["height"]

tray_img = Image.open(os.path.join(os.getcwd(), "logo.png"))
logo_path = (
pathlib.Path(
sys._MEIPASS
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS")
else os.getcwd()
)
/ "logo.png"
)
tray_img = Image.open(logo_path)
icon = Icon(
"arknights-mower",
icon=tray_img,
Expand Down

0 comments on commit 860cfcd

Please sign in to comment.