refactor(source): 优化窗口大小和背景图显示

- 设置窗口最小和最大尺寸
- 优化背景图加载和显示,使用setScaledContents简化处理
- 调整标题栏和菜单区域的大小和位置
- 重构部分UI代码,提高可读性和维护性
This commit is contained in:
hyb-oyqq
2025-07-25 17:21:30 +08:00
parent 38549e098e
commit f6a57215c2
4 changed files with 53 additions and 26 deletions

View File

@@ -37,6 +37,19 @@ def load_base64_image(base64_str):
pixmap.loadFromData(base64.b64decode(base64_str))
return pixmap
def load_image_from_file(file_path):
"""加载图像文件到QPixmap
Args:
file_path: 图像文件路径
Returns:
QPixmap: 加载的图像
"""
if os.path.exists(file_path):
return QPixmap(file_path)
return QPixmap()
def msgbox_frame(title, text, buttons=QtWidgets.QMessageBox.StandardButton.NoButton):
msg_box = QtWidgets.QMessageBox()
msg_box.setWindowTitle(title)