Skip to content

Commit 71459ea

Browse files
committed
新增 **关于页面横幅**,显示软件横幅图片
1 parent 70f1977 commit 71459ea

4 files changed

Lines changed: 45 additions & 3 deletions

File tree

CHANGELOG/v2.1.0/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ v2.0 - Koharu(小鸟游星野) release 2
33
## 🚀 主要更新
44

55
- 新增 **精简设置模式**,仅显示推荐的功能项,减少用户操作难度
6+
- 新增 **关于页面横幅**,显示软件横幅图片
67

78
## 💡 功能优化
89

app/tools/variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# -------------------- 软件基本信息 --------------------
1010
APPLY_NAME = "SecRandom" # 软件名称
1111
VERSION = "v0.0.0" # 软件当前版本
12-
NEXT_VERSION = "v2.0.0" # 软件下一个版本
12+
NEXT_VERSION = "v2.1.0" # 软件下一个版本
1313
CODENAME = "Koharu" # 软件代号
1414
SPECIAL_VERSION = VERSION if VERSION != "v0.0.0" else NEXT_VERSION
1515
SYSTEM = "windows" if os.name == "nt" else "linux" # 软件系统

app/view/settings/about.py

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,50 @@
2020

2121

2222
# ==================================================
23-
# 关于卡片类
23+
# 关于主容器类
2424
# ==================================================
25-
class about(GroupHeaderCardWidget):
25+
class about(QWidget):
26+
def __init__(self, parent=None):
27+
super().__init__(parent)
28+
# 创建垂直布局
29+
self.vBoxLayout = QVBoxLayout(self)
30+
self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
31+
self.vBoxLayout.setSpacing(10)
32+
33+
# 添加横幅组件
34+
self.banner_widget = about_banner(self)
35+
self.vBoxLayout.addWidget(self.banner_widget)
36+
37+
# 添加关于信息组件
38+
self.about_info_widget = about_info(self)
39+
self.vBoxLayout.addWidget(self.about_info_widget)
40+
41+
42+
# ==================================================
43+
# 横幅组件类
44+
# ==================================================
45+
class about_banner(QWidget):
46+
def __init__(self, parent=None):
47+
super().__init__(parent)
48+
banner_path = get_data_path("assets/icon", "secrandom-banner.png")
49+
self.banner_image = ImageLabel(f"{banner_path}")
50+
self.banner_image.scaledToHeight(350)
51+
self.banner_image.setBorderRadius(12, 12, 12, 12)
52+
self.banner_image.setScaledContents(True)
53+
54+
# 添加横幅图片到布局
55+
self.vBoxLayout = QHBoxLayout(self)
56+
self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
57+
self.vBoxLayout.setSpacing(0)
58+
59+
# 使图片居中
60+
self.vBoxLayout.addWidget(self.banner_image, 0, Qt.AlignmentFlag.AlignCenter)
61+
62+
63+
# ==================================================
64+
# 关于信息组件类
65+
# ==================================================
66+
class about_info(GroupHeaderCardWidget):
2667
def __init__(self, parent=None):
2768
super().__init__(parent)
2869
self.setTitle(get_content_name_async("about", "title"))
347 KB
Loading

0 commit comments

Comments
 (0)