add image paths
This commit is contained in:
@ -3,6 +3,7 @@ from PySide6.QtGui import QPixmap, QFont, QPainter
|
||||
from PySide6.QtCore import Qt, QTimer, QDateTime
|
||||
|
||||
import resources.resources_rc
|
||||
from utils.image_paths import ImagePaths
|
||||
|
||||
# 自定义消息容器, 显示系统消息
|
||||
class MsgContainer(QWidget):
|
||||
@ -11,7 +12,7 @@ class MsgContainer(QWidget):
|
||||
self.setFixedSize(770, 24)
|
||||
|
||||
# 加载消息区域背景图
|
||||
self.bg_pixmap = QPixmap(":/icons/images/系统消息背景.png") # 替换为实际路径
|
||||
self.bg_pixmap = QPixmap(ImagePaths.SYSTEM_MSG_BACKGROUND) # 替换为实际路径
|
||||
if self.bg_pixmap.isNull():
|
||||
print("警告:系统消息背景.png 加载失败")
|
||||
|
||||
@ -24,7 +25,7 @@ class MsgContainer(QWidget):
|
||||
self.msg_icon = QLabel()
|
||||
self.msg_icon.setFixedSize(13, 18)
|
||||
# self.msg_icon.setStyleSheet("background-color:red;")
|
||||
self.msg_icon.setPixmap(QPixmap(":/icons/images/系统消息喇叭.png")) # 替换为实际路径
|
||||
self.msg_icon.setPixmap(QPixmap(ImagePaths.SYSTEM_MSG_HORN)) # 替换为实际路径
|
||||
msg_layout.addWidget(self.msg_icon, alignment=Qt.AlignVCenter | Qt.AlignLeft)
|
||||
|
||||
# 消息文本
|
||||
@ -53,7 +54,7 @@ class SystemNavBar(QWidget):
|
||||
self.setFixedSize(1280, 80)
|
||||
|
||||
# 1. 加载背景图
|
||||
self.bg_pixmap = QPixmap(":/icons/images/系统主界面导航栏.png") # 替换为实际图片路径
|
||||
self.bg_pixmap = QPixmap(ImagePaths.SYSTEM_MAIN_NAV) # 替换为实际图片路径
|
||||
if self.bg_pixmap.isNull():
|
||||
print("警告:背景图加载失败,请检查路径!")
|
||||
|
||||
@ -70,11 +71,11 @@ class SystemNavBar(QWidget):
|
||||
# 系统logo
|
||||
self.logo = QLabel()
|
||||
self.logo.setFixedSize(53, 53)
|
||||
self.logo.setPixmap(QPixmap(":/icons/images/系统logo.png"))
|
||||
self.logo.setPixmap(QPixmap(ImagePaths.SYSTEM_LOGO))
|
||||
left_layout.addWidget(self.logo, alignment=Qt.AlignTop)
|
||||
# 系统总标题
|
||||
self.title = QLabel()
|
||||
self.title.setPixmap(QPixmap(":/icons/images/系统总标题.png"))
|
||||
self.title.setPixmap(QPixmap(ImagePaths.SYSTEM_TOTAL_TITLE))
|
||||
left_layout.addWidget(self.title, alignment=Qt.AlignCenter)
|
||||
main_layout.addWidget(left_container, alignment=Qt.AlignTop)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user