Files
JITToolBox/ui/pyui/picker_ui.py
2025-06-03 23:55:16 +08:00

42 lines
1.7 KiB
Python

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)