添加抽答页面

This commit is contained in:
2025-06-03 23:55:16 +08:00
parent 5e73571705
commit a2250d25cf
3 changed files with 41 additions and 2 deletions

View File

@@ -20,8 +20,8 @@ class MainWindow(MSFluentWindow):
self.achievementInterface = AchievementWidget('Achievement Interface', self)
self.defenseInterface = DefenseWidget('Defense Interface', self)
self.aboutInterface = AboutWidget('About Interface', self)
self.pickerInterface = PickerWidget('Picker Interface', self)
if not is_frozen():
self.pickerInterface = PickerWidget('Picker Interface', self)
self.testInterface = TestWidget('Test Interface', self)
self.achievementInterface.error.connect(self.showError)
@@ -33,8 +33,8 @@ class MainWindow(MSFluentWindow):
def initNavigation(self):
self.addSubInterface(self.achievementInterface, FluentIcon.SPEED_HIGH, '达成度')
self.addSubInterface(self.defenseInterface, FluentIcon.FEEDBACK, '答辩')
self.addSubInterface(self.pickerInterface, FluentIcon.PEOPLE, '抽答')
if not is_frozen():
self.addSubInterface(self.pickerInterface, FluentIcon.PEOPLE, '抽答')
self.addSubInterface(self.testInterface, FluentIcon.VIEW, '测试')
self.addSubInterface(self.aboutInterface, FluentIcon.INFO, '关于', position=NavigationItemPosition.BOTTOM)

View File

@@ -1,6 +1,41 @@
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout
from qfluentwidgets import GroupHeaderCardWidget, PushButton, FluentIcon, PrimaryPushButton, IconWidget, BodyLabel
from ui import MAIN_THEME_COLOR
from ui.components.widget import Widget
class PickerWidget(Widget):
def __init__(self, key: str, parent=None):
super().__init__(key, parent)
self.card = GroupHeaderCardWidget(self)
self.vbox = QVBoxLayout(self)
self.chooseBtn = PushButton("打开")
self.startButton = PrimaryPushButton(FluentIcon.PLAY_SOLID, "抽签")
self.bottomLayout = QHBoxLayout()
self.hintIcon = IconWidget(FluentIcon.INFO.icon(color=MAIN_THEME_COLOR))
self.hintLabel = BodyLabel("点击抽签按钮以开始抽签 👉")
self.card.setTitle("输入选项")
self.chooseBtn.setFixedWidth(120)
self.startButton.setFixedWidth(120)
self.startButton.setEnabled(False)
self.hintIcon.setFixedSize(16, 16)
self.hintIcon.autoFillBackground()
self.bottomLayout.setSpacing(10)
self.bottomLayout.setContentsMargins(24, 15, 24, 20)
self.bottomLayout.addWidget(self.hintIcon, 0, Qt.AlignLeft)
self.bottomLayout.addWidget(self.hintLabel, 0, Qt.AlignLeft)
self.bottomLayout.addStretch(1)
self.bottomLayout.addWidget(self.startButton, 0, Qt.AlignRight)
self.bottomLayout.setAlignment(Qt.AlignVCenter)
self.group = self.card.addGroup(FluentIcon.DOCUMENT, "抽答名单", "选择抽答名单", self.chooseBtn)
self.group.setSeparatorVisible(True)
self.card.vBoxLayout.addLayout(self.bottomLayout)
self.vbox.addWidget(self.card)
self.vbox.addStretch(1)