|
20 | 20 |
|
21 | 21 |
|
22 | 22 | # ================================================== |
23 | | -# 关于卡片类 |
| 23 | +# 关于主容器类 |
24 | 24 | # ================================================== |
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): |
26 | 67 | def __init__(self, parent=None): |
27 | 68 | super().__init__(parent) |
28 | 69 | self.setTitle(get_content_name_async("about", "title")) |
|
0 commit comments