361 lines
11 KiB
Python
361 lines
11 KiB
Python
|
# coding: gb2312
|
|||
|
from PyQt5.QtCore import Qt, QSize
|
|||
|
from PyQt5.QtGui import QIcon
|
|||
|
from PyQt5.QtWidgets import *
|
|||
|
from BaseFrontend.based_widget import BasedWidget
|
|||
|
|
|||
|
|
|||
|
class RunningConfigPageWidgetDefine(BasedWidget):
|
|||
|
|
|||
|
def __init__(self):
|
|||
|
super().__init__()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>Ctrl+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>༭<EFBFBD><E0BCAD>
|
|||
|
"""**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>"""
|
|||
|
# <20>հؼ<D7BF>
|
|||
|
self.empty_box = self._init_empty_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һҳ
|
|||
|
self.back_pre_button = self._init_back_pre_button()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
self.title_label = self._init_title_widget()
|
|||
|
# <20>ؼҰ<D8BC>ť
|
|||
|
self.back_home_button = self._init_back_button_widget()
|
|||
|
# һ<><D2BB>ֱ<EFBFBD><D6B1>
|
|||
|
self.line_widget = self._init_line_widget()
|
|||
|
# <20><>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.round_title = self._init_round_title_widget()
|
|||
|
# <20><>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.round_down_button = self._init_round_down_button_widget()
|
|||
|
# <20><>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD>ֵ
|
|||
|
self.round_num_widget = self._init_round_num_widget()
|
|||
|
# <20><>Ȧ<EFBFBD><C8A6><EFBFBD>Ӻ<EFBFBD>
|
|||
|
self.round_add_button = self._init_round_add_button_widget()
|
|||
|
# <20><>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ֵwidget<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ߿<C3B1>
|
|||
|
self.all_round_button_widget = self._init_all_round_button_widget()
|
|||
|
# Ȧʱ<C8A6><CAB1><EFBFBD><EFBFBD>
|
|||
|
self.round_time_title = self._init_round_time_title_widget()
|
|||
|
# Ȧʱ<C8A6><CAB1><EFBFBD><EFBFBD>
|
|||
|
self.round_time_down_button = self._init_round_time_down_button_widget()
|
|||
|
# Ȧʱ<C8A6><CAB1>ֵ
|
|||
|
self.round_time_widget = self._init_round_time_num_widget()
|
|||
|
# Ȧʱ<C8A6>Ӻ<EFBFBD>
|
|||
|
self.round_time_add_button = self._init_round_time_add_button_widget()
|
|||
|
# <20><>СȦʱ<C8A6><CAB1>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ֵwidget<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ߿<C3B1>
|
|||
|
self.round_time_button_widget = self._init_round_time_button_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ť
|
|||
|
# self.sound_button = self._init_sound_button_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
# self.sound_label = self._init_sound_label_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
|||
|
self.sound_checkbox = self._init_sound_checkbox_widget()
|
|||
|
# <20><>ȷ<EFBFBD>ϲμӳ<CEBC><D3B3>ܿ<EFBFBD><DCBF>Ե<EFBFBD><D4B5><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
self.running_tips_label = self._init_running_tips_label_widget()
|
|||
|
# <20>μӳ<CEBC><D3B3><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.scroll_area = self._init_scroll_area_widget()
|
|||
|
# <20><>ȷ<EFBFBD>ϲμӿ<CEBC><D3BF>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD>һ<EFBFBD><D2BB>widget<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ߿<C3B1>
|
|||
|
self.main_widget = self._init_main_widget()
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ť
|
|||
|
self.start_button = self._init_start_button_widget()
|
|||
|
# logoͼ<6F><CDBC>
|
|||
|
self.logo_label = self._init_logo_label()
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD>հؼ<D7BF>
|
|||
|
@staticmethod
|
|||
|
def _init_empty_widget():
|
|||
|
empty_widget = QFrame()
|
|||
|
empty_widget.setFrameShape(QFrame.Box)
|
|||
|
empty_widget.setLineWidth(0)
|
|||
|
return empty_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_back_pre_button():
|
|||
|
back_pre_button = QPushButton()
|
|||
|
icon = QIcon("assets/left.png")
|
|||
|
back_pre_button.setIconSize(QSize(60, 60))
|
|||
|
back_pre_button.setIcon(icon)
|
|||
|
back_pre_button.setStyleSheet(
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return back_pre_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_title_widget():
|
|||
|
title_label = QLabel("<ѵ<><D1B5><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>>")
|
|||
|
title_label.setAlignment(Qt.AlignCenter)
|
|||
|
title_label.setStyleSheet(
|
|||
|
"font: 30px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px"
|
|||
|
)
|
|||
|
return title_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_back_button_widget():
|
|||
|
back_home_button = QPushButton("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ")
|
|||
|
icon = QIcon("assets/home.png")
|
|||
|
back_home_button.setIconSize(QSize(32, 32))
|
|||
|
back_home_button.setIcon(icon)
|
|||
|
back_home_button.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"border:none;"
|
|||
|
"color:#222222;"
|
|||
|
"letter-spacing: 10px;"
|
|||
|
"border-radius:4px;"
|
|||
|
"border:1px solid #222222"
|
|||
|
";height: 60%;"
|
|||
|
)
|
|||
|
return back_home_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_line_widget():
|
|||
|
line = QFrame()
|
|||
|
line.setFixedHeight(1) # <20><><EFBFBD>ø߶<C3B8>Ϊ 2 <20><><EFBFBD><EFBFBD>
|
|||
|
line.setStyleSheet("border:1px solid #000000")
|
|||
|
line.setFrameShape(QFrame.HLine) # <20><><EFBFBD><EFBFBD>Ϊˮƽ<CBAE><C6BD>
|
|||
|
return line
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_round_title_widget():
|
|||
|
round_title = QLabel("<EFBFBD><EFBFBD>Ȧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
round_title.setStyleSheet(
|
|||
|
"font: 28px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px;"
|
|||
|
)
|
|||
|
return round_title
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_round_down_button_widget():
|
|||
|
round_down_button = QPushButton("-")
|
|||
|
round_down_button.setStyleSheet(
|
|||
|
"font: 100px \"Microsoft YaHei UI\";"
|
|||
|
"color: #ffffff;"
|
|||
|
"background-color: #409eff;"
|
|||
|
"height: 100%;"
|
|||
|
"margin-top: -9px;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return round_down_button
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>Ȧ<EFBFBD><C8A6><EFBFBD><EFBFBD>ֵ
|
|||
|
@staticmethod
|
|||
|
def _init_round_num_widget():
|
|||
|
round_num = QLabel("3")
|
|||
|
round_num.setAlignment(Qt.AlignCenter)
|
|||
|
round_num.setStyleSheet(
|
|||
|
"font: 600 30px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px;"
|
|||
|
"border-top: 2px solid #e7e7e7;"
|
|||
|
"border-bottom: 2px solid #e7e7e7;"
|
|||
|
"border-left: none;"
|
|||
|
"border-right: none;"
|
|||
|
)
|
|||
|
return round_num
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>Ȧ<EFBFBD><C8A6><EFBFBD>Ӻ<EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_round_add_button_widget():
|
|||
|
round_add_button = QPushButton("+")
|
|||
|
round_add_button.setStyleSheet(
|
|||
|
"font: 75px \"Microsoft YaHei UI\";"
|
|||
|
"color: #ffffff;"
|
|||
|
"background-color: #409eff;"
|
|||
|
"height: 100%;"
|
|||
|
"margin-top: -9px;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return round_add_button
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>Ȧ<EFBFBD><C8A6><EFBFBD>Ӻ<EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_all_round_button_widget():
|
|||
|
all_round_button_widget = QWidget()
|
|||
|
all_round_button_widget.setStyleSheet(
|
|||
|
"border: 2px solid #e7e7e7;"
|
|||
|
)
|
|||
|
return all_round_button_widget
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC>Ȧʱ<C8A6><CAB1><EFBFBD><EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_round_time_title_widget():
|
|||
|
round_time_title = QLabel("<EFBFBD><EFBFBD>СȦʱ<EFBFBD><EFBFBD>")
|
|||
|
round_time_title.setStyleSheet(
|
|||
|
"font: 28px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px;"
|
|||
|
)
|
|||
|
return round_time_title
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC>Ȧʱ<C8A6><CAB1><EFBFBD><EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_round_time_down_button_widget():
|
|||
|
round_time_down_button = QPushButton("-")
|
|||
|
round_time_down_button.setStyleSheet(
|
|||
|
"font: 100px \"Microsoft YaHei UI\";"
|
|||
|
"color: #ffffff;"
|
|||
|
"background-color: #409eff;"
|
|||
|
"height: 100%;"
|
|||
|
"margin-top: -9px;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return round_time_down_button
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC>Ȧʱ<C8A6><CAB1>ֵ
|
|||
|
@staticmethod
|
|||
|
def _init_round_time_num_widget():
|
|||
|
round_time_num = QLabel("60")
|
|||
|
round_time_num.setAlignment(Qt.AlignCenter)
|
|||
|
round_time_num.setStyleSheet(
|
|||
|
"font: 600 30px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px;"
|
|||
|
"border-top: 2px solid #e7e7e7;"
|
|||
|
"border-bottom: 2px solid #e7e7e7;"
|
|||
|
"border-left: none;"
|
|||
|
"border-right: none;"
|
|||
|
)
|
|||
|
return round_time_num
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC>Ȧʱ<C8A6>Ӻ<EFBFBD>
|
|||
|
@staticmethod
|
|||
|
def _init_round_time_add_button_widget():
|
|||
|
round_time_add_button = QPushButton("+")
|
|||
|
round_time_add_button.setStyleSheet(
|
|||
|
"font: 75px \"Microsoft YaHei UI\";"
|
|||
|
"color: #ffffff;"
|
|||
|
"background-color: #409eff;"
|
|||
|
"height: 100%;"
|
|||
|
"margin-top: -9px;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return round_time_add_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_round_time_button_widget():
|
|||
|
round_time_button_widget = QWidget()
|
|||
|
round_time_button_widget.setStyleSheet(
|
|||
|
"border: 2px solid #e7e7e7;"
|
|||
|
)
|
|||
|
return round_time_button_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_sound_label_widget():
|
|||
|
sound_label = QLabel("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
sound_label.setStyleSheet(
|
|||
|
"font: 30px \"Microsoft YaHei UI\";"
|
|||
|
)
|
|||
|
return sound_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_sound_checkbox_widget():
|
|||
|
sound_checkbox = QCheckBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
sound_checkbox.setStyleSheet(
|
|||
|
"QCheckBox { font: 30px \"Microsoft YaHei UI\"; }"
|
|||
|
)
|
|||
|
sound_checkbox.setStyleSheet(sound_checkbox.styleSheet() + "QCheckBox:checked { color: #409eff; }")
|
|||
|
return sound_checkbox
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_sound_button_widget():
|
|||
|
sound_button = QPushButton()
|
|||
|
sound_button.setFixedWidth(30)
|
|||
|
sound_button.setStyleSheet(
|
|||
|
"height: 30px;"
|
|||
|
"border: 1px solid #222222;"
|
|||
|
"border-radius: 2px;"
|
|||
|
"background-color: #ffffff;"
|
|||
|
)
|
|||
|
return sound_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_running_tips_label_widget():
|
|||
|
running_tips_label = QLabel("<EFBFBD><EFBFBD>ȷ<EFBFBD>ϲμӳ<EFBFBD><EFBFBD>ܿ<EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
running_tips_label.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px;"
|
|||
|
"border: none;"
|
|||
|
"margin-left: 20px"
|
|||
|
)
|
|||
|
return running_tips_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def init_name_label_widget():
|
|||
|
name_label = QLabel()
|
|||
|
name_label.setAlignment(Qt.AlignCenter)
|
|||
|
name_label.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"color: #101010;"
|
|||
|
"padding:0;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return name_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def init_id_label_widget():
|
|||
|
id_label = QLabel()
|
|||
|
id_label.setAlignment(Qt.AlignCenter)
|
|||
|
id_label.setStyleSheet(
|
|||
|
"border: none;"
|
|||
|
"padding: 4px 28px 4px 28px;"
|
|||
|
"font: 20px \"Microsoft YaHei UI\";"
|
|||
|
"margin: 3px 6px 6px 6px;"
|
|||
|
"background-color: #e7e7e7;"
|
|||
|
"border-radius: 4px;"
|
|||
|
"color: #454545;"
|
|||
|
)
|
|||
|
return id_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def init_person_card_widget():
|
|||
|
person_card_widget = QWidget()
|
|||
|
person_card_widget.setStyleSheet(
|
|||
|
"border-radius: 4px;"
|
|||
|
"border: 1px solid #bbbbbb;"
|
|||
|
"margin: 4px 4px 4px 4px;"
|
|||
|
)
|
|||
|
return person_card_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_scroll_area_widget():
|
|||
|
scroll_area = QScrollArea()
|
|||
|
scroll_area.setWidgetResizable(True)
|
|||
|
scroll_area.setStyleSheet(
|
|||
|
"border: none"
|
|||
|
)
|
|||
|
return scroll_area
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_main_widget():
|
|||
|
main_widget = QWidget()
|
|||
|
main_widget.setStyleSheet(
|
|||
|
"border:1px solid #bbbbbb;"
|
|||
|
"border-radius: 4px"
|
|||
|
)
|
|||
|
return main_widget
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ť
|
|||
|
@staticmethod
|
|||
|
def _init_start_button_widget():
|
|||
|
start_button = QPushButton("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
start_button.setStyleSheet(
|
|||
|
"font: 600 28px \"Microsoft YaHei UI\";"
|
|||
|
"border: none;"
|
|||
|
"color: #ffffff;"
|
|||
|
"letter-spacing: 10px;"
|
|||
|
"border-radius: 4px;"
|
|||
|
"height: 70%;"
|
|||
|
"background-color: #67c23a;"
|
|||
|
)
|
|||
|
return start_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_logo_label():
|
|||
|
logo_img = QLabel()
|
|||
|
logo_img.setStyleSheet(
|
|||
|
"border-image: url(assets/logo.png);"
|
|||
|
"background-size: contain;"
|
|||
|
"background-repeat: no-repeat;"
|
|||
|
"background-position: center;"
|
|||
|
)
|
|||
|
logo_img.setAlignment(Qt.AlignCenter)
|
|||
|
logo_img.setScaledContents(True)
|
|||
|
logo_img.setContentsMargins(12, 6, 12, 6)
|
|||
|
return logo_img
|