mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2025-12-18 13:00:29 +00:00
refactor(ui): 重构 UI 相关代码并移除冗余资源
- 从 ui_manager.py 和 install.ui 中移除了使用 base64 图片数据的方式 - 采用直接加载图片文件的方法,提高了代码的可读性和维护性 - 删除了未使用的 popup.ui 文件 - 优化了资源路径的获取方式,使用 resource_path 函数统一处理
This commit is contained in:
@@ -5,7 +5,6 @@ import webbrowser
|
||||
|
||||
from utils import load_base64_image, msgbox_frame
|
||||
from data.config import APP_NAME, APP_VERSION
|
||||
from data.pic_data import img_data
|
||||
|
||||
class UIManager:
|
||||
def __init__(self, main_window):
|
||||
@@ -22,10 +21,11 @@ class UIManager:
|
||||
def setup_ui(self):
|
||||
"""设置UI元素,包括窗口图标、标题和菜单"""
|
||||
# 设置窗口图标
|
||||
icon_data = img_data.get("icon")
|
||||
if icon_data:
|
||||
pixmap = load_base64_image(icon_data)
|
||||
self.main_window.setWindowIcon(QIcon(pixmap))
|
||||
import os
|
||||
from utils import resource_path
|
||||
icon_path = resource_path(os.path.join("IMG", "ICO", "icon.png"))
|
||||
if os.path.exists(icon_path):
|
||||
self.main_window.setWindowIcon(QIcon(icon_path))
|
||||
|
||||
# 设置窗口标题
|
||||
self.main_window.setWindowTitle(f"{APP_NAME} v{APP_VERSION}")
|
||||
|
||||
Reference in New Issue
Block a user