refactor(ui): 重构 UI 相关代码并移除冗余资源

- 从 ui_manager.py 和 install.ui 中移除了使用 base64 图片数据的方式
- 采用直接加载图片文件的方法,提高了代码的可读性和维护性
- 删除了未使用的 popup.ui 文件
- 优化了资源路径的获取方式,使用 resource_path 函数统一处理
This commit is contained in:
hyb-oyqq
2025-07-28 15:22:31 +08:00
parent 642b2ec17f
commit 331f7a25d2
5 changed files with 27 additions and 375 deletions

View File

@@ -9,7 +9,6 @@ import psutil
from PySide6 import QtCore, QtWidgets
import re
from PySide6.QtGui import QIcon, QPixmap
from data.pic_data import img_data
from data.config import APP_NAME, CONFIG_FILE
def resource_path(relative_path):
@@ -55,9 +54,10 @@ def msgbox_frame(title, text, buttons=QtWidgets.QMessageBox.StandardButton.NoBut
msg_box.setWindowTitle(title)
msg_box.setWindowModality(QtCore.Qt.WindowModality.WindowModal)
icon_data = img_data.get("icon")
if icon_data:
pixmap = load_base64_image(icon_data)
# 直接加载图标文件
icon_path = resource_path(os.path.join("IMG", "ICO", "icon.png"))
if os.path.exists(icon_path):
pixmap = QPixmap(icon_path)
if not pixmap.isNull():
msg_box.setWindowIcon(QIcon(pixmap))
msg_box.setIconPixmap(pixmap.scaled(64, 64, QtCore.Qt.AspectRatioMode.KeepAspectRatio, QtCore.Qt.TransformationMode.SmoothTransformation))