initial fluent-widgets ui

This commit is contained in:
2025-08-14 18:45:16 +08:00
parent 746e83ab23
commit 4c66886257
1198 changed files with 805339 additions and 0 deletions

View File

@ -0,0 +1,80 @@
# coding:utf-8
import sys
from PySide6.QtCore import Qt, QUrl
from PySide6.QtGui import QIcon, QDesktopServices
from PySide6.QtWidgets import QApplication
from qfluentwidgets import (NavigationItemPosition, MessageBox, setTheme, Theme,
NavigationAvatarWidget, SplitFluentWindow, FluentTranslator)
from qfluentwidgets import FluentIcon as FIF
from view.focus_interface import FocusInterface
from view.stop_watch_interface import StopWatchInterface
class Window(SplitFluentWindow):
def __init__(self):
super().__init__()
# create sub interface
self.focusInterface = FocusInterface(self)
self.stopWatchInterface = StopWatchInterface(self)
self.initNavigation()
self.initWindow()
def initNavigation(self):
# add sub interface
self.addSubInterface(self.focusInterface, FIF.RINGER, '专注时段')
self.addSubInterface(self.stopWatchInterface, FIF.STOP_WATCH, '秒表')
self.navigationInterface.addWidget(
routeKey='avatar',
widget=NavigationAvatarWidget('zhiyiYo', 'resource/images/shoko.png'),
onClick=self.showMessageBox,
position=NavigationItemPosition.BOTTOM,
)
self.navigationInterface.addItem(
routeKey='settingInterface',
icon=FIF.SETTING,
text='设置',
position=NavigationItemPosition.BOTTOM,
)
self.navigationInterface.setExpandWidth(280)
def initWindow(self):
self.resize(900, 700)
self.setWindowIcon(QIcon(':/qfluentwidgets/images/logo.png'))
self.setWindowTitle('PyQt-Fluent-Widgets')
desktop = QApplication.screens()[0].availableGeometry()
w, h = desktop.width(), desktop.height()
self.move(w//2 - self.width()//2, h//2 - self.height()//2)
def showMessageBox(self):
w = MessageBox(
'支持作者🥰',
'个人开发不易,如果这个项目帮助到了您,可以考虑请作者喝一瓶快乐水🥤。您的支持就是作者开发和维护项目的动力🚀',
self
)
w.yesButton.setText('来啦老弟')
w.cancelButton.setText('下次一定')
if w.exec():
QDesktopServices.openUrl(QUrl("https://afdian.net/a/zhiyiYo"))
if __name__ == '__main__':
setTheme(Theme.DARK)
app = QApplication(sys.argv)
# install translator
translator = FluentTranslator()
app.installTranslator(translator)
w = Window()
w.show()
app.exec()

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

View File

@ -0,0 +1,7 @@
<RCC>
<qresource>
<file>images/todo.png</file>
<file>images/alarms.png</file>
<file>images/tips.png</file>
</qresource>
</RCC>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,336 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StopWatchInterface</class>
<widget class="QWidget" name="StopWatchInterface">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>867</width>
<height>781</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="BodyLabel" name="timeLabel">
<property name="text">
<string>00:00:00</string>
</property>
<property name="lightColor" stdset="0">
<color>
<red>96</red>
<green>96</green>
<blue>96</blue>
</color>
</property>
<property name="darkColor" stdset="0">
<color>
<red>206</red>
<green>206</green>
<blue>206</blue>
</color>
</property>
<property name="pixelFontSize" stdset="0">
<number>100</number>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="TitleLabel" name="hourLabel">
<property name="text">
<string>小时</string>
</property>
<property name="lightColor" stdset="0">
<color>
<red>96</red>
<green>96</green>
<blue>96</blue>
</color>
</property>
<property name="darkColor" stdset="0">
<color>
<red>206</red>
<green>206</green>
<blue>206</blue>
</color>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>60</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="TitleLabel" name="minuteLabel">
<property name="text">
<string>分钟</string>
</property>
<property name="lightColor" stdset="0">
<color>
<red>96</red>
<green>96</green>
<blue>96</blue>
</color>
</property>
<property name="darkColor" stdset="0">
<color>
<red>206</red>
<green>206</green>
<blue>206</blue>
</color>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>90</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="TitleLabel" name="secondLabel">
<property name="text">
<string>秒</string>
</property>
<property name="lightColor" stdset="0">
<color>
<red>96</red>
<green>96</green>
<blue>96</blue>
</color>
</property>
<property name="darkColor" stdset="0">
<color>
<red>206</red>
<green>206</green>
<blue>206</blue>
</color>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>50</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>24</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="PillToolButton" name="startButton">
<property name="minimumSize">
<size>
<width>68</width>
<height>68</height>
</size>
</property>
<property name="iconSize">
<size>
<width>21</width>
<height>21</height>
</size>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="PillToolButton" name="flagButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>68</width>
<height>68</height>
</size>
</property>
<property name="iconSize">
<size>
<width>21</width>
<height>21</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="PillToolButton" name="restartButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>68</width>
<height>68</height>
</size>
</property>
<property name="iconSize">
<size>
<width>21</width>
<height>21</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ToolButton</class>
<extends>QToolButton</extends>
<header>qfluentwidgets</header>
</customwidget>
<customwidget>
<class>PillToolButton</class>
<extends>ToggleToolButton</extends>
<header>qfluentwidgets</header>
</customwidget>
<customwidget>
<class>ToggleToolButton</class>
<extends>ToolButton</extends>
<header>qfluentwidgets</header>
</customwidget>
<customwidget>
<class>BodyLabel</class>
<extends>QLabel</extends>
<header>qfluentwidgets</header>
</customwidget>
<customwidget>
<class>TitleLabel</class>
<extends>QLabel</extends>
<header>qfluentwidgets</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,556 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'FocusInterface.ui'
##
## Created by: Qt User Interface Compiler version 6.4.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLayout,
QProgressBar, QSizePolicy, QSpacerItem, QVBoxLayout,
QWidget)
from qfluentwidgets import (BodyLabel, CardWidget, CheckBox, IconWidget,
LargeTitleLabel, PrimaryPushButton, ProgressBar, ProgressRing,
PushButton, StrongBodyLabel, SubtitleLabel, TimePicker,
ToolButton, TransparentToolButton)
import resource_rc
class Ui_FocusInterface(object):
def setupUi(self, FocusInterface):
if not FocusInterface.objectName():
FocusInterface.setObjectName(u"FocusInterface")
FocusInterface.resize(911, 807)
self.horizontalLayout_3 = QHBoxLayout(FocusInterface)
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
self.gridLayout = QGridLayout()
self.gridLayout.setSpacing(12)
self.gridLayout.setObjectName(u"gridLayout")
self.gridLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
self.gridLayout.setContentsMargins(20, 40, 20, 20)
self.progressCard = CardWidget(FocusInterface)
self.progressCard.setObjectName(u"progressCard")
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.progressCard.sizePolicy().hasHeightForWidth())
self.progressCard.setSizePolicy(sizePolicy)
self.progressCard.setMinimumSize(QSize(380, 410))
self.progressCard.setMaximumSize(QSize(600, 410))
self.verticalLayout_4 = QVBoxLayout(self.progressCard)
self.verticalLayout_4.setObjectName(u"verticalLayout_4")
self.verticalLayout_4.setSizeConstraint(QLayout.SetDefaultConstraint)
self.verticalLayout_2 = QVBoxLayout()
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.verticalLayout_2.setSizeConstraint(QLayout.SetMinAndMaxSize)
self.horizontalLayout_4 = QHBoxLayout()
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
self.horizontalLayout_4.setContentsMargins(5, -1, -1, -1)
self.progressIcon = IconWidget(self.progressCard)
self.progressIcon.setObjectName(u"progressIcon")
self.progressIcon.setMinimumSize(QSize(18, 18))
self.progressIcon.setMaximumSize(QSize(18, 18))
icon = QIcon()
icon.addFile(u":/images/tips.png", QSize(), QIcon.Normal, QIcon.Off)
self.progressIcon.setIcon(icon)
self.horizontalLayout_4.addWidget(self.progressIcon)
self.horizontalSpacer_8 = QSpacerItem(2, 20, QSizePolicy.Fixed, QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(self.horizontalSpacer_8)
self.dailyProgressLabel = StrongBodyLabel(self.progressCard)
self.dailyProgressLabel.setObjectName(u"dailyProgressLabel")
self.horizontalLayout_4.addWidget(self.dailyProgressLabel)
self.horizontalSpacer_9 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(self.horizontalSpacer_9)
self.editButton = TransparentToolButton(self.progressCard)
self.editButton.setObjectName(u"editButton")
self.horizontalLayout_4.addWidget(self.editButton, 0, Qt.AlignRight)
self.verticalLayout_2.addLayout(self.horizontalLayout_4)
self.horizontalLayout_5 = QHBoxLayout()
self.horizontalLayout_5.setObjectName(u"horizontalLayout_5")
self.horizontalLayout_5.setSizeConstraint(QLayout.SetMinAndMaxSize)
self.verticalLayout_5 = QVBoxLayout()
self.verticalLayout_5.setObjectName(u"verticalLayout_5")
self.verticalSpacer_5 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_5.addItem(self.verticalSpacer_5)
self.yesterdayLabel = BodyLabel(self.progressCard)
self.yesterdayLabel.setObjectName(u"yesterdayLabel")
self.verticalLayout_5.addWidget(self.yesterdayLabel, 0, Qt.AlignHCenter|Qt.AlignVCenter)
self.yesterdayTimeLabel = LargeTitleLabel(self.progressCard)
self.yesterdayTimeLabel.setObjectName(u"yesterdayTimeLabel")
self.verticalLayout_5.addWidget(self.yesterdayTimeLabel, 0, Qt.AlignHCenter|Qt.AlignVCenter)
self.minuteLabel1 = BodyLabel(self.progressCard)
self.minuteLabel1.setObjectName(u"minuteLabel1")
self.verticalLayout_5.addWidget(self.minuteLabel1, 0, Qt.AlignHCenter|Qt.AlignVCenter)
self.verticalSpacer_6 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_5.addItem(self.verticalSpacer_6)
self.horizontalLayout_5.addLayout(self.verticalLayout_5)
self.verticalLayout_10 = QVBoxLayout()
self.verticalLayout_10.setObjectName(u"verticalLayout_10")
self.verticalSpacer_15 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_10.addItem(self.verticalSpacer_15)
self.targetLabel = SubtitleLabel(self.progressCard)
self.targetLabel.setObjectName(u"targetLabel")
self.targetLabel.setAlignment(Qt.AlignCenter)
self.verticalLayout_10.addWidget(self.targetLabel)
self.progressRing = ProgressRing(self.progressCard)
self.progressRing.setObjectName(u"progressRing")
sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy1.setHorizontalStretch(1)
sizePolicy1.setVerticalStretch(1)
sizePolicy1.setHeightForWidth(self.progressRing.sizePolicy().hasHeightForWidth())
self.progressRing.setSizePolicy(sizePolicy1)
self.progressRing.setMinimumSize(QSize(150, 150))
self.progressRing.setMaximumSize(QSize(220, 220))
font = QFont()
font.setFamilies([u"Microsoft YaHei UI"])
font.setPointSize(10)
font.setBold(False)
self.progressRing.setFont(font)
self.progressRing.setMaximum(24)
self.progressRing.setValue(10)
self.progressRing.setAlignment(Qt.AlignCenter)
self.progressRing.setTextVisible(True)
self.progressRing.setOrientation(Qt.Horizontal)
self.progressRing.setTextDirection(QProgressBar.TopToBottom)
self.progressRing.setUseAni(False)
self.progressRing.setVal(10.000000000000000)
self.progressRing.setStrokeWidth(15)
self.verticalLayout_10.addWidget(self.progressRing)
self.verticalSpacer_16 = QSpacerItem(20, 3, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout_10.addItem(self.verticalSpacer_16)
self.finishTimeLabel = BodyLabel(self.progressCard)
self.finishTimeLabel.setObjectName(u"finishTimeLabel")
self.verticalLayout_10.addWidget(self.finishTimeLabel, 0, Qt.AlignHCenter)
self.verticalSpacer_13 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_10.addItem(self.verticalSpacer_13)
self.verticalLayout_10.setStretch(2, 1)
self.horizontalLayout_5.addLayout(self.verticalLayout_10)
self.verticalLayout_6 = QVBoxLayout()
self.verticalLayout_6.setObjectName(u"verticalLayout_6")
self.verticalSpacer_9 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_6.addItem(self.verticalSpacer_9)
self.continousComplianceDayLabel = BodyLabel(self.progressCard)
self.continousComplianceDayLabel.setObjectName(u"continousComplianceDayLabel")
self.verticalLayout_6.addWidget(self.continousComplianceDayLabel, 0, Qt.AlignHCenter|Qt.AlignVCenter)
self.compianceDayLabel = LargeTitleLabel(self.progressCard)
self.compianceDayLabel.setObjectName(u"compianceDayLabel")
self.verticalLayout_6.addWidget(self.compianceDayLabel, 0, Qt.AlignHCenter)
self.dayLabel = BodyLabel(self.progressCard)
self.dayLabel.setObjectName(u"dayLabel")
self.verticalLayout_6.addWidget(self.dayLabel, 0, Qt.AlignHCenter)
self.verticalSpacer_10 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_6.addItem(self.verticalSpacer_10)
self.horizontalLayout_5.addLayout(self.verticalLayout_6)
self.horizontalLayout_5.setStretch(0, 1)
self.horizontalLayout_5.setStretch(1, 2)
self.horizontalLayout_5.setStretch(2, 1)
self.verticalLayout_2.addLayout(self.horizontalLayout_5)
self.verticalLayout_4.addLayout(self.verticalLayout_2)
self.gridLayout.addWidget(self.progressCard, 0, 1, 1, 1)
self.focusCard = CardWidget(FocusInterface)
self.focusCard.setObjectName(u"focusCard")
sizePolicy.setHeightForWidth(self.focusCard.sizePolicy().hasHeightForWidth())
self.focusCard.setSizePolicy(sizePolicy)
self.focusCard.setMinimumSize(QSize(380, 410))
self.focusCard.setMaximumSize(QSize(600, 410))
self.focusCard.setStyleSheet(u"")
self.verticalLayout_3 = QVBoxLayout(self.focusCard)
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
self.verticalLayout_3.setSizeConstraint(QLayout.SetDefaultConstraint)
self.verticalLayout = QVBoxLayout()
self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setSizeConstraint(QLayout.SetDefaultConstraint)
self.horizontalLayout_2 = QHBoxLayout()
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
self.horizontalLayout_2.setContentsMargins(5, -1, -1, -1)
self.focusCardIcon = IconWidget(self.focusCard)
self.focusCardIcon.setObjectName(u"focusCardIcon")
self.focusCardIcon.setMinimumSize(QSize(20, 20))
self.focusCardIcon.setMaximumSize(QSize(20, 20))
icon1 = QIcon()
icon1.addFile(u":/images/alarms.png", QSize(), QIcon.Normal, QIcon.Off)
self.focusCardIcon.setIcon(icon1)
self.horizontalLayout_2.addWidget(self.focusCardIcon)
self.focusPeriodLabel = StrongBodyLabel(self.focusCard)
self.focusPeriodLabel.setObjectName(u"focusPeriodLabel")
self.horizontalLayout_2.addWidget(self.focusPeriodLabel)
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(self.horizontalSpacer)
self.pinButton = TransparentToolButton(self.focusCard)
self.pinButton.setObjectName(u"pinButton")
self.horizontalLayout_2.addWidget(self.pinButton)
self.moreButton = TransparentToolButton(self.focusCard)
self.moreButton.setObjectName(u"moreButton")
self.horizontalLayout_2.addWidget(self.moreButton)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.verticalSpacer_12 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout.addItem(self.verticalSpacer_12)
self.prepareFocusLabel = SubtitleLabel(self.focusCard)
self.prepareFocusLabel.setObjectName(u"prepareFocusLabel")
self.prepareFocusLabel.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.prepareFocusLabel)
self.horizontalLayout_6 = QHBoxLayout()
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
self.horizontalLayout_6.setContentsMargins(15, 10, 15, -1)
self.hintLabel = BodyLabel(self.focusCard)
self.hintLabel.setObjectName(u"hintLabel")
self.hintLabel.setAlignment(Qt.AlignCenter)
self.hintLabel.setWordWrap(True)
self.hintLabel.setMargin(0)
self.hintLabel.setProperty("lightColor", QColor(96, 96, 96))
self.hintLabel.setProperty("darkColor", QColor(206, 206, 206))
self.horizontalLayout_6.addWidget(self.hintLabel)
self.verticalLayout.addLayout(self.horizontalLayout_6)
self.verticalSpacer_2 = QSpacerItem(20, 20, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout.addItem(self.verticalSpacer_2)
self.timePicker = TimePicker(self.focusCard)
self.timePicker.setObjectName(u"timePicker")
self.timePicker.setSecondVisible(True)
self.verticalLayout.addWidget(self.timePicker, 0, Qt.AlignHCenter)
self.verticalSpacer_3 = QSpacerItem(20, 10, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout.addItem(self.verticalSpacer_3)
self.bottomHintLabel = BodyLabel(self.focusCard)
self.bottomHintLabel.setObjectName(u"bottomHintLabel")
self.bottomHintLabel.setAlignment(Qt.AlignCenter)
self.verticalLayout.addWidget(self.bottomHintLabel, 0, Qt.AlignHCenter)
self.verticalSpacer_11 = QSpacerItem(20, 10, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout.addItem(self.verticalSpacer_11)
self.skipRelaxCheckBox = CheckBox(self.focusCard)
self.skipRelaxCheckBox.setObjectName(u"skipRelaxCheckBox")
self.skipRelaxCheckBox.setEnabled(True)
self.verticalLayout.addWidget(self.skipRelaxCheckBox, 0, Qt.AlignHCenter)
self.verticalSpacer_4 = QSpacerItem(20, 20, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout.addItem(self.verticalSpacer_4)
self.startFocusButton = PrimaryPushButton(self.focusCard)
self.startFocusButton.setObjectName(u"startFocusButton")
self.startFocusButton.setAutoDefault(True)
self.verticalLayout.addWidget(self.startFocusButton, 0, Qt.AlignHCenter)
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout.addItem(self.verticalSpacer)
self.verticalLayout_3.addLayout(self.verticalLayout)
self.gridLayout.addWidget(self.focusCard, 0, 0, 1, 1)
self.taskCard = CardWidget(FocusInterface)
self.taskCard.setObjectName(u"taskCard")
self.taskCard.setMinimumSize(QSize(370, 0))
self.taskCard.setMaximumSize(QSize(600, 395))
self.verticalLayout_8 = QVBoxLayout(self.taskCard)
self.verticalLayout_8.setObjectName(u"verticalLayout_8")
self.verticalLayout_7 = QVBoxLayout()
self.verticalLayout_7.setObjectName(u"verticalLayout_7")
self.verticalLayout_7.setContentsMargins(8, -1, -1, -1)
self.horizontalLayout_7 = QHBoxLayout()
self.horizontalLayout_7.setObjectName(u"horizontalLayout_7")
self.taskCardIcon = IconWidget(self.taskCard)
self.taskCardIcon.setObjectName(u"taskCardIcon")
self.taskCardIcon.setMinimumSize(QSize(18, 18))
self.taskCardIcon.setMaximumSize(QSize(18, 18))
icon2 = QIcon()
icon2.addFile(u":/images/todo.png", QSize(), QIcon.Normal, QIcon.Off)
self.taskCardIcon.setIcon(icon2)
self.horizontalLayout_7.addWidget(self.taskCardIcon)
self.horizontalSpacer_7 = QSpacerItem(2, 2, QSizePolicy.Fixed, QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(self.horizontalSpacer_7)
self.taskLabel = StrongBodyLabel(self.taskCard)
self.taskLabel.setObjectName(u"taskLabel")
self.horizontalLayout_7.addWidget(self.taskLabel)
self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_7.addItem(self.horizontalSpacer_3)
self.addTaskButton = TransparentToolButton(self.taskCard)
self.addTaskButton.setObjectName(u"addTaskButton")
self.horizontalLayout_7.addWidget(self.addTaskButton)
self.moreTaskButton = TransparentToolButton(self.taskCard)
self.moreTaskButton.setObjectName(u"moreTaskButton")
self.horizontalLayout_7.addWidget(self.moreTaskButton)
self.verticalLayout_7.addLayout(self.horizontalLayout_7)
self.verticalSpacer_8 = QSpacerItem(20, 3, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout_7.addItem(self.verticalSpacer_8)
self.hintLabel_2 = BodyLabel(self.taskCard)
self.hintLabel_2.setObjectName(u"hintLabel_2")
self.hintLabel_2.setProperty("lightColor", QColor(96, 96, 96))
self.hintLabel_2.setProperty("darkColor", QColor(206, 206, 206))
self.verticalLayout_7.addWidget(self.hintLabel_2)
self.verticalLayout_9 = QVBoxLayout()
self.verticalLayout_9.setObjectName(u"verticalLayout_9")
self.verticalLayout_9.setContentsMargins(-1, -1, 7, -1)
self.taskCard1 = CardWidget(self.taskCard)
self.taskCard1.setObjectName(u"taskCard1")
self.taskCard1.setMinimumSize(QSize(0, 44))
self.taskCard1.setMaximumSize(QSize(16777215, 44))
self.horizontalLayout_9 = QHBoxLayout(self.taskCard1)
self.horizontalLayout_9.setObjectName(u"horizontalLayout_9")
self.horizontalLayout_9.setContentsMargins(15, -1, -1, -1)
self.horizontalLayout_8 = QHBoxLayout()
self.horizontalLayout_8.setObjectName(u"horizontalLayout_8")
self.taskIcon1 = IconWidget(self.taskCard1)
self.taskIcon1.setObjectName(u"taskIcon1")
sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
sizePolicy2.setHorizontalStretch(16)
sizePolicy2.setVerticalStretch(16)
sizePolicy2.setHeightForWidth(self.taskIcon1.sizePolicy().hasHeightForWidth())
self.taskIcon1.setSizePolicy(sizePolicy2)
self.taskIcon1.setMinimumSize(QSize(16, 16))
self.taskIcon1.setMaximumSize(QSize(16, 16))
self.horizontalLayout_8.addWidget(self.taskIcon1)
self.horizontalLayout_9.addLayout(self.horizontalLayout_8)
self.taskLabel1 = BodyLabel(self.taskCard1)
self.taskLabel1.setObjectName(u"taskLabel1")
self.taskLabel1.setProperty("pixelFontSize", 14)
self.taskLabel1.setProperty("strikeOut", True)
self.horizontalLayout_9.addWidget(self.taskLabel1)
self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_9.addItem(self.horizontalSpacer_4)
self.verticalLayout_9.addWidget(self.taskCard1)
self.taskCard2 = CardWidget(self.taskCard)
self.taskCard2.setObjectName(u"taskCard2")
self.taskCard2.setMinimumSize(QSize(0, 44))
self.taskCard2.setMaximumSize(QSize(16777215, 44))
self.horizontalLayout_12 = QHBoxLayout(self.taskCard2)
self.horizontalLayout_12.setObjectName(u"horizontalLayout_12")
self.horizontalLayout_12.setContentsMargins(15, -1, -1, -1)
self.horizontalLayout_13 = QHBoxLayout()
self.horizontalLayout_13.setObjectName(u"horizontalLayout_13")
self.taskIcon2 = IconWidget(self.taskCard2)
self.taskIcon2.setObjectName(u"taskIcon2")
sizePolicy2.setHeightForWidth(self.taskIcon2.sizePolicy().hasHeightForWidth())
self.taskIcon2.setSizePolicy(sizePolicy2)
self.taskIcon2.setMinimumSize(QSize(16, 16))
self.taskIcon2.setMaximumSize(QSize(16, 16))
self.horizontalLayout_13.addWidget(self.taskIcon2)
self.horizontalLayout_12.addLayout(self.horizontalLayout_13)
self.taskLabel2 = BodyLabel(self.taskCard2)
self.taskLabel2.setObjectName(u"taskLabel2")
self.horizontalLayout_12.addWidget(self.taskLabel2)
self.horizontalSpacer_6 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_12.addItem(self.horizontalSpacer_6)
self.verticalLayout_9.addWidget(self.taskCard2)
self.taskCard3 = CardWidget(self.taskCard)
self.taskCard3.setObjectName(u"taskCard3")
self.taskCard3.setMinimumSize(QSize(0, 44))
self.taskCard3.setMaximumSize(QSize(16777215, 44))
self.horizontalLayout_10 = QHBoxLayout(self.taskCard3)
self.horizontalLayout_10.setObjectName(u"horizontalLayout_10")
self.horizontalLayout_10.setContentsMargins(15, -1, -1, -1)
self.horizontalLayout_11 = QHBoxLayout()
self.horizontalLayout_11.setObjectName(u"horizontalLayout_11")
self.taskIcon3 = IconWidget(self.taskCard3)
self.taskIcon3.setObjectName(u"taskIcon3")
sizePolicy2.setHeightForWidth(self.taskIcon3.sizePolicy().hasHeightForWidth())
self.taskIcon3.setSizePolicy(sizePolicy2)
self.taskIcon3.setMinimumSize(QSize(16, 16))
self.taskIcon3.setMaximumSize(QSize(16, 16))
self.horizontalLayout_11.addWidget(self.taskIcon3)
self.horizontalLayout_10.addLayout(self.horizontalLayout_11)
self.taskLabel3 = BodyLabel(self.taskCard3)
self.taskLabel3.setObjectName(u"taskLabel3")
self.horizontalLayout_10.addWidget(self.taskLabel3)
self.horizontalSpacer_5 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_10.addItem(self.horizontalSpacer_5)
self.verticalLayout_9.addWidget(self.taskCard3)
self.verticalLayout_7.addLayout(self.verticalLayout_9)
self.verticalSpacer_7 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout_7.addItem(self.verticalSpacer_7)
self.verticalLayout_8.addLayout(self.verticalLayout_7)
self.gridLayout.addWidget(self.taskCard, 1, 0, 1, 1)
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.gridLayout.addItem(self.horizontalSpacer_2, 0, 2, 1, 1)
self.gridLayout.setColumnStretch(0, 1)
self.gridLayout.setColumnStretch(1, 1)
self.horizontalLayout_3.addLayout(self.gridLayout)
self.retranslateUi(FocusInterface)
QMetaObject.connectSlotsByName(FocusInterface)
# setupUi
def retranslateUi(self, FocusInterface):
FocusInterface.setWindowTitle(QCoreApplication.translate("FocusInterface", u"Form", None))
self.dailyProgressLabel.setText(QCoreApplication.translate("FocusInterface", u"\u6bcf\u65e5\u8fdb\u5ea6", None))
self.yesterdayLabel.setText(QCoreApplication.translate("FocusInterface", u"\u6628\u5929", None))
self.yesterdayTimeLabel.setText(QCoreApplication.translate("FocusInterface", u"3", None))
self.minuteLabel1.setText(QCoreApplication.translate("FocusInterface", u"\u5206\u949f", None))
self.targetLabel.setText(QCoreApplication.translate("FocusInterface", u"\u4eca\u65e5\u8ba1\u5212", None))
self.progressRing.setFormat(QCoreApplication.translate("FocusInterface", u"\u76ee\u6807 %v \u5c0f\u65f6", None))
self.finishTimeLabel.setText(QCoreApplication.translate("FocusInterface", u"\u5df2\u5b8c\u6210\uff1a0 \u5206\u949f", None))
self.continousComplianceDayLabel.setText(QCoreApplication.translate("FocusInterface", u"\u8fde\u7eed\u8fbe\u6807\u65e5", None))
self.compianceDayLabel.setText(QCoreApplication.translate("FocusInterface", u"5", None))
self.dayLabel.setText(QCoreApplication.translate("FocusInterface", u"\u5929", None))
self.focusPeriodLabel.setText(QCoreApplication.translate("FocusInterface", u"\u4e13\u6ce8\u65f6\u6bb5", None))
self.prepareFocusLabel.setText(QCoreApplication.translate("FocusInterface", u"\u51c6\u5907\u4e13\u6ce8", None))
self.hintLabel.setText(QCoreApplication.translate("FocusInterface", u"\u6211\u4eec\u5c06\u5728\u6bcf\u4e2a\u4f1a\u8bdd\u671f\u95f4\u5173\u95ed\u901a\u77e5\u548c\u5e94\u7528\u8b66\u62a5\u3002\u5bf9\u4e8e\u8f83\u957f\u7684\u4f1a\u8bdd\uff0c\u6211\u4eec\u5c06\u6dfb\u52a0\u7b80\u77ed\u7684\u4f11\u606f\u65f6\u95f4\uff0c\u4ee5\u4fbf\u4f60\u53ef\u4ee5\u6062\u590d\u7cbe\u529b\u3002", None))
self.bottomHintLabel.setText(QCoreApplication.translate("FocusInterface", u"\u4f60\u5c06\u6ca1\u6709\u4f11\u606f\u65f6\u95f4\u3002", None))
self.skipRelaxCheckBox.setText(QCoreApplication.translate("FocusInterface", u"\u8df3\u8fc7\u4f11\u606f", None))
self.startFocusButton.setText(QCoreApplication.translate("FocusInterface", u"\u542f\u52a8\u4e13\u6ce8\u65f6\u6bb5", None))
self.taskLabel.setText(QCoreApplication.translate("FocusInterface", u"\u4efb\u52a1", None))
self.hintLabel_2.setText(QCoreApplication.translate("FocusInterface", u"\u4e3a\u4f1a\u8bdd\u9009\u62e9\u4efb\u52a1", None))
self.taskLabel1.setText(QCoreApplication.translate("FocusInterface", u"\u5168\u519b\u51fa\u9e21\uff0c\u8a93\u6b7b\u4fdd\u536b\u9e3d\u9e3d\uff01\uff01", None))
self.taskLabel2.setText(QCoreApplication.translate("FocusInterface", u"\u4e0a\u4f20\u6211\u5bb6 aiko \u7684 MV\u300e\u30b7\u30a2\u30ef\u30bb\u300f", None))
self.taskLabel3.setText(QCoreApplication.translate("FocusInterface", u"\u4e0b\u8f7d\u6211\u5bb6 aiko \u7684\u65b0\u6b4c\u300e\u8352\u308c\u305f\u5507\u306f\u604b\u3092\u5931\u304f\u3059\u300f", None))
# retranslateUi

View File

@ -0,0 +1,150 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'StopWatchInterface.ui'
##
## Created by: Qt User Interface Compiler version 6.4.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QSizePolicy, QSpacerItem,
QVBoxLayout, QWidget)
from qfluentwidgets import (BodyLabel, PillToolButton, TitleLabel, ToggleToolButton,
ToolButton)
class Ui_StopWatchInterface(object):
def setupUi(self, StopWatchInterface):
if not StopWatchInterface.objectName():
StopWatchInterface.setObjectName(u"StopWatchInterface")
StopWatchInterface.resize(867, 781)
self.verticalLayout_2 = QVBoxLayout(StopWatchInterface)
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.verticalLayout = QVBoxLayout()
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout.addItem(self.verticalSpacer)
self.timeLabel = BodyLabel(StopWatchInterface)
self.timeLabel.setObjectName(u"timeLabel")
self.timeLabel.setProperty("lightColor", QColor(96, 96, 96))
self.timeLabel.setProperty("darkColor", QColor(206, 206, 206))
self.timeLabel.setProperty("pixelFontSize", 100)
self.verticalLayout.addWidget(self.timeLabel, 0, Qt.AlignHCenter)
self.horizontalLayout_3 = QHBoxLayout()
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(self.horizontalSpacer_4)
self.hourLabel = TitleLabel(StopWatchInterface)
self.hourLabel.setObjectName(u"hourLabel")
self.hourLabel.setProperty("lightColor", QColor(96, 96, 96))
self.hourLabel.setProperty("darkColor", QColor(206, 206, 206))
self.horizontalLayout_3.addWidget(self.hourLabel)
self.horizontalSpacer_6 = QSpacerItem(60, 20, QSizePolicy.Fixed, QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(self.horizontalSpacer_6)
self.minuteLabel = TitleLabel(StopWatchInterface)
self.minuteLabel.setObjectName(u"minuteLabel")
self.minuteLabel.setProperty("lightColor", QColor(96, 96, 96))
self.minuteLabel.setProperty("darkColor", QColor(206, 206, 206))
self.horizontalLayout_3.addWidget(self.minuteLabel)
self.horizontalSpacer_7 = QSpacerItem(90, 17, QSizePolicy.Fixed, QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(self.horizontalSpacer_7)
self.secondLabel = TitleLabel(StopWatchInterface)
self.secondLabel.setObjectName(u"secondLabel")
self.secondLabel.setProperty("lightColor", QColor(96, 96, 96))
self.secondLabel.setProperty("darkColor", QColor(206, 206, 206))
self.horizontalLayout_3.addWidget(self.secondLabel)
self.horizontalSpacer_5 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(self.horizontalSpacer_5)
self.verticalLayout.addLayout(self.horizontalLayout_3)
self.verticalSpacer_3 = QSpacerItem(20, 50, QSizePolicy.Minimum, QSizePolicy.Fixed)
self.verticalLayout.addItem(self.verticalSpacer_3)
self.horizontalLayout_2 = QHBoxLayout()
self.horizontalLayout_2.setSpacing(24)
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(self.horizontalSpacer)
self.startButton = PillToolButton(StopWatchInterface)
self.startButton.setObjectName(u"startButton")
self.startButton.setMinimumSize(QSize(68, 68))
self.startButton.setIconSize(QSize(21, 21))
self.startButton.setChecked(True)
self.horizontalLayout_2.addWidget(self.startButton)
self.flagButton = PillToolButton(StopWatchInterface)
self.flagButton.setObjectName(u"flagButton")
self.flagButton.setEnabled(False)
self.flagButton.setMinimumSize(QSize(68, 68))
self.flagButton.setIconSize(QSize(21, 21))
self.horizontalLayout_2.addWidget(self.flagButton)
self.restartButton = PillToolButton(StopWatchInterface)
self.restartButton.setObjectName(u"restartButton")
self.restartButton.setEnabled(False)
self.restartButton.setMinimumSize(QSize(68, 68))
self.restartButton.setIconSize(QSize(21, 21))
self.horizontalLayout_2.addWidget(self.restartButton)
self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(self.horizontalSpacer_2)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.verticalLayout.addItem(self.verticalSpacer_2)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.retranslateUi(StopWatchInterface)
QMetaObject.connectSlotsByName(StopWatchInterface)
# setupUi
def retranslateUi(self, StopWatchInterface):
StopWatchInterface.setWindowTitle(QCoreApplication.translate("StopWatchInterface", u"Form", None))
self.timeLabel.setText(QCoreApplication.translate("StopWatchInterface", u"00:00:00", None))
self.hourLabel.setText(QCoreApplication.translate("StopWatchInterface", u"\u5c0f\u65f6", None))
self.minuteLabel.setText(QCoreApplication.translate("StopWatchInterface", u"\u5206\u949f", None))
self.secondLabel.setText(QCoreApplication.translate("StopWatchInterface", u"\u79d2", None))
# retranslateUi

View File

@ -0,0 +1,38 @@
# coding:utf-8
from PySide6.QtGui import QColor
from PySide6.QtWidgets import QWidget, QGraphicsDropShadowEffect
from qfluentwidgets import FluentIcon, setFont, InfoBarIcon
from view.Ui_FocusInterface import Ui_FocusInterface
class FocusInterface(Ui_FocusInterface, QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setupUi(self)
# set the icon of button
self.pinButton.setIcon(FluentIcon.PIN)
self.moreButton.setIcon(FluentIcon.MORE)
self.startFocusButton.setIcon(FluentIcon.POWER_BUTTON)
self.editButton.setIcon(FluentIcon.EDIT)
self.addTaskButton.setIcon(FluentIcon.ADD)
self.moreTaskButton.setIcon(FluentIcon.MORE)
self.taskIcon1.setIcon(InfoBarIcon.SUCCESS)
self.taskIcon2.setIcon(InfoBarIcon.WARNING)
self.taskIcon3.setIcon(InfoBarIcon.WARNING)
setFont(self.progressRing, 16)
# add shadow effect to card
self.setShadowEffect(self.focusCard)
self.setShadowEffect(self.progressCard)
self.setShadowEffect(self.taskCard)
def setShadowEffect(self, card: QWidget):
shadowEffect = QGraphicsDropShadowEffect(self)
shadowEffect.setColor(QColor(0, 0, 0, 15))
shadowEffect.setBlurRadius(10)
shadowEffect.setOffset(0, 0)
card.setGraphicsEffect(shadowEffect)

View File

@ -0,0 +1,16 @@
# coding:utf-8
from PySide6.QtWidgets import QWidget
from qfluentwidgets import FluentIcon
from view.Ui_StopWatchInterface import Ui_StopWatchInterface
class StopWatchInterface(Ui_StopWatchInterface, QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setupUi(self)
self.startButton.setIcon(FluentIcon.POWER_BUTTON)
self.flagButton.setIcon(FluentIcon.FLAG)
self.restartButton.setIcon(FluentIcon.CANCEL)