修改配色 & 静态资源 & 软件名
This commit is contained in:
2
ui/__init__.py
Normal file
2
ui/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
MAIN_THEME_COLOR = "#0064b0"
|
||||
BLUE_BACKGROUND_COLOR = "#dbeafe"
|
||||
11
ui/main.py
11
ui/main.py
@@ -1,9 +1,11 @@
|
||||
from PySide6.QtGui import QIcon, QShowEvent
|
||||
from qfluentwidgets import FluentIcon, MSFluentWindow, NavigationItemPosition, MessageBox
|
||||
from qfluentwidgets import FluentIcon, MSFluentWindow, NavigationItemPosition, MessageBox, setThemeColor
|
||||
|
||||
from ui import MAIN_THEME_COLOR, BLUE_BACKGROUND_COLOR
|
||||
from ui.pyui.about_ui import AboutWidget
|
||||
from ui.pyui.achievement_ui import AchievementWidget
|
||||
from ui.pyui.defense_ui import DefenseWidget
|
||||
from ui.pyui.picker_ui import PickerWidget
|
||||
from ui.pyui.test_ui import TestWidget
|
||||
from utils.function import is_frozen
|
||||
|
||||
@@ -12,9 +14,13 @@ class MainWindow(MSFluentWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
setThemeColor(MAIN_THEME_COLOR)
|
||||
self.setCustomBackgroundColor(BLUE_BACKGROUND_COLOR, BLUE_BACKGROUND_COLOR)
|
||||
|
||||
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.testInterface = TestWidget('Test Interface', self)
|
||||
|
||||
@@ -27,6 +33,7 @@ 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.testInterface, FluentIcon.VIEW, '测试')
|
||||
|
||||
@@ -34,7 +41,7 @@ class MainWindow(MSFluentWindow):
|
||||
|
||||
def initWindow(self):
|
||||
self.resize(900, 700)
|
||||
self.setWindowTitle('建工工具箱')
|
||||
self.setWindowTitle('教学工具箱')
|
||||
self.setWindowIcon(QIcon(':/images/logo.png'))
|
||||
|
||||
def showError(self, title: str, message: str):
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from PySide6.QtGui import QDesktopServices, Qt
|
||||
from PySide6.QtWidgets import QVBoxLayout, QHBoxLayout
|
||||
from pyparsing import version_info
|
||||
from qfluentwidgets import PrimaryPushSettingCard, FluentIcon, GroupHeaderCardWidget, PushButton, ImageLabel, TitleLabel
|
||||
|
||||
from ui.components.widget import Widget
|
||||
@@ -13,7 +12,7 @@ class AboutWidget(Widget):
|
||||
|
||||
self.logoImage = ImageLabel(':/images/logo.png')
|
||||
self.logoImage.scaledToHeight(100)
|
||||
self.appNameLabel = TitleLabel('建工工具箱🛠️')
|
||||
self.appNameLabel = TitleLabel('教学工具箱 🛠️')
|
||||
|
||||
self.hBox = QHBoxLayout()
|
||||
self.hBox.addWidget(self.logoImage, 0, Qt.AlignLeft)
|
||||
@@ -52,10 +51,10 @@ class AboutWidget(Widget):
|
||||
self.vbox.addWidget(self.group_card)
|
||||
self.vbox.addStretch(1)
|
||||
|
||||
self.group_card.addGroup("", "PySide6", self.url_list[0], self.button_list[0])
|
||||
self.group_card.addGroup("", "QFluentWidgets", self.url_list[1], self.button_list[1])
|
||||
self.group_card.addGroup("", "openpyxl", self.url_list[2], self.button_list[2])
|
||||
self.group_card.addGroup("", "python-docx", self.url_list[3], self.button_list[3])
|
||||
self.group_card.addGroup(":/images/3rd/qt.png", "PySide6", self.url_list[0], self.button_list[0])
|
||||
self.group_card.addGroup(":/images/3rd/qfluentwidgets", "QFluentWidgets", self.url_list[1], self.button_list[1])
|
||||
self.group_card.addGroup(FluentIcon.LAYOUT, "openpyxl", self.url_list[2], self.button_list[2])
|
||||
self.group_card.addGroup(FluentIcon.LAYOUT, "python-docx", self.url_list[3], self.button_list[3])
|
||||
|
||||
self.version_card.clicked.connect(
|
||||
lambda: QDesktopServices.openUrl("https://cantyonion.site/git/cantyonion/DefenseTopicGenerator")
|
||||
|
||||
@@ -4,13 +4,14 @@ from typing import Callable, Literal
|
||||
|
||||
from PySide6.QtCore import Qt, Signal, QThread
|
||||
from PySide6.QtWidgets import QVBoxLayout, QFileDialog, QHBoxLayout
|
||||
from qfluentwidgets import GroupHeaderCardWidget, FluentIcon, PushButton, LineEdit, IconWidget, InfoBarIcon, BodyLabel, \
|
||||
from qfluentwidgets import GroupHeaderCardWidget, FluentIcon, PushButton, LineEdit, IconWidget, BodyLabel, \
|
||||
PrimaryPushButton, SwitchButton
|
||||
|
||||
from module import LOGLEVEL
|
||||
from module.worker import ARGWorker
|
||||
from ui.components.infobar import ProgressInfoBar
|
||||
from ui.components.widget import Widget
|
||||
from ui import MAIN_THEME_COLOR
|
||||
|
||||
|
||||
class InputSettingCard(GroupHeaderCardWidget):
|
||||
@@ -56,12 +57,13 @@ class OutputSettingCard(GroupHeaderCardWidget):
|
||||
|
||||
self.autoOpenSwitch.setChecked(True)
|
||||
self.bottomLayout = QHBoxLayout()
|
||||
self.hintIcon = IconWidget(InfoBarIcon.INFORMATION)
|
||||
self.hintIcon = IconWidget(FluentIcon.INFO.icon(color=MAIN_THEME_COLOR))
|
||||
self.hintLabel = BodyLabel("点击开始按钮以开始生成 👉")
|
||||
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)
|
||||
|
||||
@@ -3,12 +3,13 @@ from typing import Literal, Callable
|
||||
|
||||
from PySide6.QtCore import Qt, Signal, QThread
|
||||
from PySide6.QtWidgets import QHBoxLayout, QVBoxLayout, QFileDialog
|
||||
from qfluentwidgets import GroupHeaderCardWidget, PushButton, IconWidget, InfoBarIcon, \
|
||||
BodyLabel, PrimaryPushButton, FluentIcon, LineEdit
|
||||
from qfluentwidgets import GroupHeaderCardWidget, PushButton, IconWidget, BodyLabel, PrimaryPushButton, FluentIcon, \
|
||||
LineEdit
|
||||
|
||||
from module.worker import DTGWorker
|
||||
from ui.components.infobar import ProgressInfoBar
|
||||
from ui.components.widget import Widget
|
||||
from ui import MAIN_THEME_COLOR
|
||||
|
||||
|
||||
class InitSettingCard(GroupHeaderCardWidget):
|
||||
@@ -61,7 +62,7 @@ class ExportSettingsCard(GroupHeaderCardWidget):
|
||||
self.exportFileNameLineEdit = LineEdit()
|
||||
self.startButton = PrimaryPushButton(FluentIcon.PLAY_SOLID, "开始")
|
||||
|
||||
self.hintIcon = IconWidget(InfoBarIcon.INFORMATION)
|
||||
self.hintIcon = IconWidget(FluentIcon.INFO.icon(color=MAIN_THEME_COLOR))
|
||||
self.hintLabel = BodyLabel("点击开始按钮以开始生成 👉")
|
||||
self.chooseExportDirectoryButton.setFixedWidth(120)
|
||||
self.startButton.setFixedWidth(120)
|
||||
|
||||
6
ui/pyui/picker_ui.py
Normal file
6
ui/pyui/picker_ui.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from ui.components.widget import Widget
|
||||
|
||||
|
||||
class PickerWidget(Widget):
|
||||
def __init__(self, key: str, parent=None):
|
||||
super().__init__(key, parent)
|
||||
Reference in New Issue
Block a user