diff --git a/README.md b/README.md index d0e25541f1..e565db44fb 100644 --- a/README.md +++ b/README.md @@ -112,4 +112,4 @@ Fork 本项目并开启工作流更新 ## 赞赏 -![image](./docs/images/appreciate.jpg) +![image](./static/images/appreciate.jpg) diff --git a/README_en.md b/README_en.md index 417e846cfa..265cf7b7e9 100644 --- a/README_en.md +++ b/README_en.md @@ -112,4 +112,4 @@ If you don't want to bother, and my configuration just meets your needs, you can ## Appreciate -![image](./docs/images/appreciate.jpg) +![image](./static/images/appreciate.jpg) diff --git a/docs/images/appreciate.jpg b/static/images/appreciate.jpg similarity index 100% rename from docs/images/appreciate.jpg rename to static/images/appreciate.jpg diff --git a/static/images/favicon.ico b/static/images/favicon.ico index 919c9e60bd..b68c23b620 100644 Binary files a/static/images/favicon.ico and b/static/images/favicon.ico differ diff --git a/static/images/logo.png b/static/images/logo.png deleted file mode 100644 index dcb5bff2ff..0000000000 Binary files a/static/images/logo.png and /dev/null differ diff --git a/tkinter_ui/about.py b/tkinter_ui/about.py index 11d42f7820..3e1e0a943e 100644 --- a/tkinter_ui/about.py +++ b/tkinter_ui/about.py @@ -1,6 +1,7 @@ import tkinter as tk from PIL import Image, ImageTk import webbrowser +from utils.config import resource_path class AboutUI: @@ -60,14 +61,14 @@ def init_ui(self, root=None, version=None): ) disclaimer_label.pack() - image = Image.open("docs/images/appreciate.jpg") + image = Image.open(resource_path("static/images/appreciate.jpg")) resized_image = image.resize((250, 250)) photo = ImageTk.PhotoImage(resized_image) image_label = tk.Label(about_window, image=photo) image_label.image = photo image_label.pack() - appreciate_label = tk.Label(about_window, text="欢迎赞助") + appreciate_label = tk.Label(about_window, text="您的赞助是我更新的动力") appreciate_label.pack() confirm_button = tk.ttk.Button( diff --git a/tkinter_ui/tkinter_ui.py b/tkinter_ui/tkinter_ui.py index f6c3a2ad39..7abb119020 100644 --- a/tkinter_ui/tkinter_ui.py +++ b/tkinter_ui/tkinter_ui.py @@ -213,7 +213,5 @@ def get_root_location(root): screen_width = root.winfo_screenwidth() screen_height = root.winfo_screenheight() root.geometry("%dx%d+%d+%d" % get_root_location(root)) - icon = tk.PhotoImage(file="static/images/logo.png") - root.iconphoto(True, icon) - root.iconbitmap("static/images/favicon.ico") + root.iconbitmap(resource_path("static/images/favicon.ico")) root.mainloop() diff --git a/tkinter_ui/tkinter_ui.spec b/tkinter_ui/tkinter_ui.spec index f0ca2a0b4f..6d5d6bd1f5 100644 --- a/tkinter_ui/tkinter_ui.spec +++ b/tkinter_ui/tkinter_ui.spec @@ -1,7 +1,7 @@ # -*- mode: python ; coding: utf-8 -*- a = Analysis( - ['tkinter_ui.py', 'default.py', 'multicast.py', 'hotel.py', 'subscribe.py', 'online_search.py'], + ['tkinter_ui.py', 'about.py', 'default.py', 'multicast.py', 'hotel.py', 'subscribe.py', 'online_search.py'], pathex=[], binaries=[], datas=[ @@ -9,6 +9,9 @@ a = Analysis( ('../config/demo.txt', 'config'), ('../updates/multicast/multicast_map.json', 'updates/multicast'), ('../updates/multicast/multicast_region_result.json', 'updates/multicast'), + ('../static/images/favicon.ico', 'static/images'), + ('../static/images/appreciate.jpg', 'static/images'), + ('about.py', '.'), ('default.py', '.'), ('multicast.py', '.'), ('hotel.py', '.'), @@ -46,4 +49,5 @@ exe = EXE( target_arch=None, codesign_identity=None, entitlements_file=None, + icon='../static/images/favicon.ico' )