From c7a4ce7963509f84f6dff504756499c24a2830db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A8=AA?= <2938139566@qq.com> Date: Fri, 10 Oct 2025 16:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=83=E5=B8=B9=20UI=E7=92=81=E6=8D=90?= =?UTF-8?q?=EE=85=B8=E6=B5=BC=E6=A8=BA=E5=AF=B2:=20=E9=8F=8D=E8=A7=84?= =?UTF-8?q?=E5=B5=81Figma=E7=92=81=E6=8D=90=EE=85=B8=E9=8D=9A=E5=B1=BE?= =?UTF-8?q?=EE=84=9E=E9=8F=81=E7=BF=A0=E7=B6=8B=E7=94=AF=E5=86=A8=E7=9C=AC?= =?UTF-8?q?=E9=8D=9C=E5=B2=83=E5=A3=8A=E7=92=8B=3F=20-=20=E7=BC=81?= =?UTF-8?q?=E7=86=B6=E7=AB=B4=E5=A8=A3=E8=BE=AB=E5=A3=8A=E6=B6=93=E5=A9=9A?= =?UTF-8?q?=EE=95=BD=E9=96=B0=E5=B6=88=E5=A3=8A=E9=8F=82=E8=A7=84=EE=94=8D?= =?UTF-8?q?=20(#19191b=E9=91=B3=E5=B1=BE=E6=AB=99,=20#3067c0=E9=92=83?= =?UTF-8?q?=E6=BF=8A=E5=A3=8A=E6=A5=82=E6=A8=B9=E5=AF=92)=20-=20=E6=B5=BC?= =?UTF-8?q?=E6=A8=BA=E5=AF=B2=E7=80=9B=E6=A4=BE=E7=B6=8B=E7=81=9E=E5=82=9C?= =?UTF-8?q?=E9=AA=87=E7=BB=AF=E8=8D=A4=E7=B2=BA=20(16/14/12/10px)=20-=20?= =?UTF-8?q?=E9=8F=87=E5=AD=98=E6=9F=8A=E9=8E=B5=E2=82=AC=E9=8F=88=E5=A4=8A?= =?UTF-8?q?=E4=BB=A0=E9=97=88=E7=8A=B5=E7=8D=A5=E9=8D=99=EF=BD=86=E7=89=B1?= =?UTF-8?q?=E5=AF=AE=3F(=E7=81=9E=E5=82=9C=E9=AA=87/=E7=81=9E=E7=82=B4?= =?UTF-8?q?=E2=82=AC=3F=E9=91=B4=E6=B0=AD=E6=B9=B0/=E7=92=A7=E5=8B=AC?= =?UTF-8?q?=E7=B0=AE/=E9=8E=BA=D1=83=E5=9F=97=E9=8D=99=3F=20-=20=E6=B5=BC?= =?UTF-8?q?=E6=A8=BA=E5=AF=B2QGroupBox=E9=8F=8D=E5=B3=B0=E7=B4=A1=20(?= =?UTF-8?q?=E9=96=AB=E5=BF=94=E6=A7=91=E9=91=B3=E5=B1=BE=E6=AB=99,=2080%?= =?UTF-8?q?=E9=96=AB=E5=BF=94=E6=A7=91=E6=90=B4=EF=B8=BD=E7=88=A3=E6=A3=B0?= =?UTF-8?q?=3F=20-=20=E7=BC=81=E7=86=B6=E7=AB=B4=E9=8D=92=E6=A5=84?= =?UTF-8?q?=E3=80=83=E9=8D=9C=E5=B1=BE=E7=88=B2=E8=A4=B0=E3=88=A1=E5=B8=B6?= =?UTF-8?q?=E6=B5=A0=E8=88=B5=E7=89=B1=E5=AF=AE=3F-=20=E6=B5=BC=E6=A8=BA?= =?UTF-8?q?=E5=AF=B2=E9=8F=8D=E5=9B=A9=EE=84=B7=E6=A4=A4=E5=9E=AB=E7=89=B1?= =?UTF-8?q?=E5=AF=AE=3F(=E9=92=83=E6=BF=8A=E5=A3=8A=E9=96=AB=E5=A4=89?= =?UTF-8?q?=E8=85=91,=20=E9=90=8F=E6=8B=8C=E5=A3=8A=E9=8F=88=EE=81=88?= =?UTF-8?q?=E2=82=AC=E5=A4=89=E8=85=91)=20-=20=E7=BB=89=E5=A9=9A=E6=AB=8E?= =?UTF-8?q?=E6=B6=93=E5=B6=85=E7=B9=80=E7=91=95=E4=BD=BA=E6=AE=91=E6=9D=88?= =?UTF-8?q?=E8=A7=84=EE=94=8B,=20=E7=80=B9=E7=82=B5=E5=B9=87=E9=8F=83?= =?UTF-8?q?=E7=8A=B5=E7=B4=B3=E9=8F=81=E6=9D=91=E6=82=8E=20-=20=E7=92=8B?= =?UTF-8?q?=E5=86=A9=E6=9A=A3=E6=9D=88=E6=92=B3=E5=8F=86=E5=A6=97=E5=97=97?= =?UTF-8?q?=E6=8B=B0=E9=8E=B8=E5=A4=90=E6=8C=B3=E9=90=A8=E5=8B=AA=E6=B0=A6?= =?UTF-8?q?=E6=B5=9C=E6=8E=93=E6=99=A5=E9=8F=8B=3F=20=E9=8F=89=E3=83=A6?= =?UTF-8?q?=E7=B0=AE:=20Figma=E6=A3=B0=E6=88=A6=E4=BA=BE=206glyi82d=20?= =?UTF-8?q?=E9=90=98=E8=88=B5=E2=82=AC=3F=20=E9=89=81=3F=E7=92=81=E6=8D=90?= =?UTF-8?q?=EE=85=B8=E9=8D=9A=E5=B1=BE=EE=84=9E=E7=80=B9=E5=B1=BE=E5=9E=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/main_window.py | 570 +++++++++++++++++++++++++++------------------- 1 file changed, 340 insertions(+), 230 deletions(-) diff --git a/ui/main_window.py b/ui/main_window.py index 01dc5b6c..641e4ab9 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -49,106 +49,124 @@ class MainWindow(QMainWindow): self.setStyleSheet(""" QMainWindow { - background-color: #1e1e2e; + background-color: #000000; } QMenuBar { - background-color: #252538; - color: #e0e0ff; - border-bottom: 1px solid #3a3a4a; + background-color: #000000; + color: #ffffff; + border-bottom: 1px solid #4c5c6e; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 14px; + font-weight: 400; } QMenuBar::item { background-color: transparent; - padding: 4px 8px; + padding: 6px 12px; + color: #ffffff; } QMenuBar::item:selected { - background-color: rgba(139, 92, 246, 100); + background-color: rgba(48, 103, 192, 0.4); } QMenuBar::item:pressed { - background-color: rgba(139, 92, 246, 150); + background-color: rgba(48, 103, 192, 0.6); } QMenu { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ebebeb; + border: 1px solid #4c5c6e; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 14px; } QMenu::item { - padding: 4px 20px; + padding: 6px 20px; } QMenu::item:selected { - background-color: rgba(139, 92, 246, 100); + background-color: rgba(48, 103, 192, 0.4); } QPushButton { - background-color: #8b5cf6; - color: white; + background-color: rgba(89, 98, 118, 0.4); + color: #ebebeb; border: none; padding: 6px 12px; - border-radius: 4px; - font-weight: 500; + border-radius: 2px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-weight: 300; + font-size: 10px; } QPushButton:hover { - background-color: #7c3aed; + background-color: #3067c0; + color: #ffffff; } QPushButton:pressed { - background-color: #6d28d9; + background-color: #2556a0; } QPushButton:disabled { - background-color: #4c4c6e; - color: #8888aa; + background-color: #394560; + color: rgba(235, 235, 235, 0.5); } QComboBox { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; + background-color: rgba(89, 100, 113, 0.2); + color: #ebebeb; + border: 1px solid rgba(76, 92, 110, 0.6); + border-radius: 2px; padding: 4px 8px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; } QComboBox::drop-down { border: none; } QComboBox QAbstractItemView { - background-color: #2d2d44; - color: #e0e0ff; - selection-background-color: rgba(139, 92, 246, 100); + background-color: #596471; + color: #ebebeb; + selection-background-color: rgba(48, 103, 192, 0.4); } QLineEdit { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; + background-color: rgba(89, 100, 113, 0.2); + color: #ebebeb; + border: 1px solid rgba(76, 92, 110, 0.6); + border-radius: 2px; padding: 4px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; } QSpinBox, QDoubleSpinBox { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; + background-color: rgba(89, 100, 113, 0.2); + color: #ebebeb; + border: 1px solid rgba(76, 92, 110, 0.6); + border-radius: 2px; padding: 4px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; } QScrollBar:vertical { - background-color: #252538; - width: 15px; + background-color: #19191b; + width: 12px; border: none; } QScrollBar::handle:vertical { - background-color: #3a3a4a; - border-radius: 4px; + background-color: #596471; + border-radius: 2px; min-height: 20px; } QScrollBar::handle:vertical:hover { - background-color: #8b5cf6; + background-color: #3067c0; } QScrollBar:horizontal { - background-color: #252538; - width: 15px; + background-color: #19191b; + height: 12px; border: none; } QScrollBar::handle:horizontal { - background-color: #3a3a4a; - border-radius: 4px; - min-height: 20px; + background-color: #596471; + border-radius: 2px; + min-width: 20px; } QScrollBar::handle:horizontal:hover { - background-color: #8b5cf6; + background-color: #3067c0; } """) # 设置 QMessageBox 样式表 @@ -177,31 +195,37 @@ class MainWindow(QMainWindow): # 设置 QMessageBox 的样式表 msg_box_style = """ QMessageBox { - background-color: #252538; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ebebeb; + border: 1px solid #4c5c6e; } QMessageBox QLabel { - color: #e0e0ff; + color: #ebebeb; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 12px; + font-weight: 300; } QMessageBox QPushButton { - background-color: #8b5cf6; - color: white; + background-color: rgba(89, 98, 118, 0.4); + color: #ebebeb; border: none; padding: 6px 12px; - border-radius: 4px; - font-weight: 500; + border-radius: 2px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-weight: 300; + font-size: 10px; min-width: 80px; } QMessageBox QPushButton:hover { - background-color: #7c3aed; + background-color: #3067c0; + color: #ffffff; } QMessageBox QPushButton:pressed { - background-color: #6d28d9; + background-color: #2556a0; } QMessageBox QPushButton:disabled { - background-color: #4c4c6e; - color: #8888aa; + background-color: #394560; + color: rgba(235, 235, 235, 0.5); } """ @@ -219,38 +243,45 @@ class MainWindow(QMainWindow): # 设置样式表 dialog.setStyleSheet(""" QInputDialog { - background-color: #252538; - color: #e0e0ff; + background-color: #19191b; + color: #ebebeb; } QLabel { - color: #e0e0ff; + color: #ffffff; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; font-weight: 500; + font-size: 14px; } QLineEdit { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; + background-color: rgba(89, 100, 113, 0.2); + color: #ebebeb; + border: 1px solid rgba(76, 92, 110, 0.6); + border-radius: 2px; padding: 6px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; } QPushButton { - background-color: #8b5cf6; - color: white; + background-color: rgba(89, 98, 118, 0.4); + color: #ebebeb; border: none; padding: 6px 12px; - border-radius: 4px; - font-weight: 500; + border-radius: 2px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-weight: 300; + font-size: 10px; min-width: 80px; } QPushButton:hover { - background-color: #7c3aed; + background-color: #3067c0; + color: #ffffff; } QPushButton:pressed { - background-color: #6d28d9; + background-color: #2556a0; } QPushButton:disabled { - background-color: #4c4c6e; - color: #8888aa; + background-color: #394560; + color: rgba(235, 235, 235, 0.5); } """) @@ -264,77 +295,91 @@ class MainWindow(QMainWindow): # 设置样式表 dialog.setStyleSheet(""" QFileDialog { - background-color: #252538; - color: #e0e0ff; + background-color: #19191b; + color: #ebebeb; } QLabel { - color: #e0e0ff; + color: #ebebeb; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; } QListView { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - alternate-background-color: #252538; + background-color: #19191b; + color: #ebebeb; + border: 1px solid #4c5c6e; + alternate-background-color: #19191b; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; } QListView::item:hover { - background-color: #3a3a4a; + background-color: #394560; } QListView::item:selected { - background-color: rgba(139, 92, 246, 100); - color: white; + background-color: rgba(48, 103, 192, 0.4); + color: #ffffff; } QTreeView { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - alternate-background-color: #252538; + background-color: #19191b; + color: #ebebeb; + border: 1px solid #4c5c6e; + alternate-background-color: #19191b; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; } QTreeView::item:hover { - background-color: #3a3a4a; + background-color: #394560; } QTreeView::item:selected { - background-color: rgba(139, 92, 246, 100); - color: white; + background-color: rgba(48, 103, 192, 0.4); + color: #ffffff; } QComboBox { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; + background-color: rgba(89, 100, 113, 0.2); + color: #ebebeb; + border: 1px solid rgba(76, 92, 110, 0.6); + border-radius: 2px; padding: 4px 8px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; } QComboBox::drop-down { border: none; } QComboBox QAbstractItemView { - background-color: #2d2d44; - color: #e0e0ff; - selection-background-color: rgba(139, 92, 246, 100); + background-color: #596471; + color: #ebebeb; + selection-background-color: rgba(48, 103, 192, 0.4); } QPushButton { - background-color: #8b5cf6; - color: white; + background-color: rgba(89, 98, 118, 0.4); + color: #ebebeb; border: none; padding: 6px 12px; - border-radius: 4px; - font-weight: 500; + border-radius: 2px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-weight: 300; + font-size: 10px; } QPushButton:hover { - background-color: #7c3aed; + background-color: #3067c0; + color: #ffffff; } QPushButton:pressed { - background-color: #6d28d9; + background-color: #2556a0; } QPushButton:disabled { - background-color: #4c4c6e; - color: #8888aa; + background-color: #394560; + color: rgba(235, 235, 235, 0.5); } QLineEdit { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; + background-color: rgba(89, 100, 113, 0.2); + color: #ebebeb; + border: 1px solid rgba(76, 92, 110, 0.6); + border-radius: 2px; padding: 4px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; } """) @@ -1104,14 +1149,18 @@ class MainWindow(QMainWindow): self.leftDock = QDockWidget("层级", self) self.leftDock.setStyleSheet(""" QDockWidget { - background-color: #252538; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ffffff; + border: none; } QDockWidget::title { - background-color: #2d2d44; - padding: 0px 0px; /* 增加内边距,提供更多的垂直空间 */ - border-bottom: 0px solid #3a3a4a; + background-color: #19191b; + padding: 8px 10px; + border-bottom: none; + text-align: left; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 14px; + font-weight: 500; } QDockWidget::close-button { background-color: #8b5cf6; @@ -1136,17 +1185,28 @@ class MainWindow(QMainWindow): background-color: #8b5cf6; /* 按下时显示紫色高亮 */ } QTreeView { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - alternate-background-color: #252538; + background-color: #19191b; + color: #ebebeb; + border: none; + alternate-background-color: #19191b; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; + outline: none; + } + QTreeView::item { + padding: 3px 0px; + border: none; } QTreeView::item:hover { - background-color: #3a3a4a; + background-color: rgba(89, 100, 113, 0.3); } QTreeView::item:selected { - background-color: rgba(139, 92, 246, 100); - color: white; + background-color: rgba(48, 103, 192, 0.4); + color: #ffffff; + } + QTreeView::branch { + background-color: #19191b; } """) self.treeWidget = CustomTreeWidget(self.world) @@ -1158,14 +1218,18 @@ class MainWindow(QMainWindow): self.rightDock = QDockWidget("属性", self) self.rightDock.setStyleSheet(""" QDockWidget { - background-color: #252538; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ffffff; + border: none; } QDockWidget::title { - background-color: #2d2d44; - padding: 0px 0px; /* 增加内边距,提供更多的垂直空间 */ - border-bottom: 0px solid #3a3a4a; + background-color: #19191b; + padding: 8px 10px; + border-bottom: none; + text-align: left; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 16px; + font-weight: 500; } QDockWidget::close-button { background-color: #8b5cf6; @@ -1190,28 +1254,37 @@ class MainWindow(QMainWindow): background-color: #8b5cf6; /* 按下时显示紫色高亮 */ } QScrollArea { - background-color: #1e1e2e; + background-color: #19191b; border: none; } QWidget#PropertyContainer { - background-color: #1e1e2e; + background-color: #19191b; } QLabel { - color: #e0e0ff; + color: #ebebeb; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; } QGroupBox { - background-color: #252538; - border: 1px solid #3a3a4a; - border-radius: 6px; - margin-top: 1ex; - color: #e0e0ff; + background-color: transparent; + border: none; + margin-top: 20px; + margin-bottom: 10px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 12px; font-weight: 500; - padding-top: 10px; /* 增加顶部内边距,使标题和内容分离 */ + color: rgba(255, 255, 255, 0.8); + padding-top: 0px; } QGroupBox::title { - padding: 0 8px; - color: #c0c0e0; + padding: 0 0 10px 0; + color: rgba(255, 255, 255, 0.8); + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 12px; font-weight: 500; + subcontrol-origin: margin; + subcontrol-position: top left; } """) @@ -1264,14 +1337,18 @@ class MainWindow(QMainWindow): self.scriptDock = QDockWidget("脚本管理", self) self.scriptDock.setStyleSheet(""" QDockWidget { - background-color: #252538; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ffffff; + border: none; } QDockWidget::title { - background-color: #2d2d44; - padding: 0px 0px; /* 增加内边距,提供更多的垂直空间 */ - border-bottom: 0px solid #3a3a4a; + background-color: #19191b; + padding: 8px 10px; + border-bottom: none; + text-align: left; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 14px; + font-weight: 500; } QDockWidget::close-button { background-color: #8b5cf6; @@ -1296,28 +1373,37 @@ class MainWindow(QMainWindow): background-color: #8b5cf6; /* 按下时显示紫色高亮 */ } QScrollArea { - background-color: #1e1e2e; + background-color: #19191b; border: none; } - QWidget#PropertyContainer { - background-color: #1e1e2e; + QWidget#ScriptContainer { + background-color: #19191b; } QLabel { - color: #e0e0ff; + color: #ebebeb; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; } QGroupBox { - background-color: #252538; - border: 1px solid #3a3a4a; - border-radius: 6px; - margin-top: 1ex; - color: #e0e0ff; + background-color: transparent; + border: none; + margin-top: 20px; + margin-bottom: 10px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 12px; font-weight: 500; - padding-top: 10px; /* 增加顶部内边距,使标题和内容分离 */ + color: rgba(255, 255, 255, 0.8); + padding-top: 0px; } QGroupBox::title { - padding: 0 8px; - color: #c0c0e0; + padding: 0 0 10px 0; + color: rgba(255, 255, 255, 0.8); + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 12px; font-weight: 500; + subcontrol-origin: margin; + subcontrol-position: top left; } """) @@ -1326,7 +1412,7 @@ class MainWindow(QMainWindow): # 设置脚本容器的背景色 self.scriptContainer.setStyleSheet(""" QWidget#ScriptContainer { - background-color: #1e1e2e; + background-color: #19191b; } """) self.scriptContainer.setObjectName("ScriptContainer") @@ -1375,14 +1461,18 @@ class MainWindow(QMainWindow): self.bottomDock = QDockWidget("资源", self) self.bottomDock.setStyleSheet(""" QDockWidget { - background-color: #252538; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ffffff; + border: none; } QDockWidget::title { - background-color: #2d2d44; - padding: 0px 0px; /* 增加内边距,提供更多的垂直空间 */ - border-bottom: 0px solid #3a3a4a; + background-color: #19191b; + padding: 8px 10px; + border-bottom: none; + text-align: left; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 14px; + font-weight: 500; } QDockWidget::close-button { background-color: #8b5cf6; @@ -1412,23 +1502,35 @@ class MainWindow(QMainWindow): # 为资源树添加样式 self.fileView.setStyleSheet(""" QTreeWidget { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - alternate-background-color: #252538; + background-color: #19191b; + color: #ebebeb; + border: none; + alternate-background-color: #19191b; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; + outline: none; + } + QTreeWidget::item { + padding: 3px 0px; + border: none; } QTreeWidget::item:hover { - background-color: #3a3a4a; + background-color: rgba(89, 100, 113, 0.3); } QTreeWidget::item:selected { - background-color: rgba(139, 92, 246, 100); - color: white; + background-color: rgba(48, 103, 192, 0.4); + color: #ffffff; } QHeaderView::section { - background-color: #2d2d44; - color: #e0e0ff; - border: 1px solid #3a3a4a; - padding: 4px; + background-color: #19191b; + color: #ebebeb; + border: none; + border-bottom: 1px solid #4c5c6e; + padding: 6px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 12px; + font-weight: 500; } """) self.bottomDock.setWidget(self.fileView) @@ -1438,14 +1540,18 @@ class MainWindow(QMainWindow): self.consoleDock = QDockWidget("控制台", self) self.consoleDock.setStyleSheet(""" QDockWidget { - background-color: #252538; - color: #e0e0ff; - border: 1px solid #3a3a4a; + background-color: #19191b; + color: #ffffff; + border: none; } QDockWidget::title { - background-color: #2d2d44; - padding: 0px 0px; /* 增加内边距,提供更多的垂直空间 */ - border-bottom: 0px solid #3a3a4a; + background-color: #19191b; + padding: 8px 10px; + border-bottom: none; + text-align: left; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 14px; + font-weight: 500; } QDockWidget::close-button { background-color: #8b5cf6; @@ -1474,10 +1580,12 @@ class MainWindow(QMainWindow): # 为控制台添加样式 self.consoleView.setStyleSheet(""" QTextEdit { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - font-family: 'Consolas', 'Monaco', monospace; + background-color: #19191b; + color: #ebebeb; + border: none; + font-family: 'Consolas', 'Monaco', 'Microsoft YaHei', monospace; + font-size: 10px; + font-weight: 300; } """) self.consoleDock.setWidget(self.consoleView) @@ -1500,44 +1608,46 @@ class MainWindow(QMainWindow): tab_bar_style = """ /* QTabBar 的整体样式 */ QTabBar { - qproperty-drawBase: 0; /* 移除标签栏底部的线条 */ + qproperty-drawBase: 0; } QTabBar::tab { - background-color: #2d2d44; /* 未选中标签的背景色,与标题栏一致 */ - color: #c0c0e0; /* 未选中标签的文字颜色 */ - border: 1px solid #3a3a4a; /* 边框颜色 */ - border-bottom: none; /* 移除底部边框 */ - border-top-left-radius: 6px; - border-top-right-radius: 6px; - padding: 8px 16px; /* 内边距,让文字不拥挤 */ + background-color: #394560; + color: rgba(255, 255, 255, 0.7); + border: 1px solid #4c5c6e; + border-bottom: none; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + padding: 8px 16px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; font-weight: 500; - margin-right: 2px; /* 标签之间的间距 */ + font-size: 14px; + margin-right: 2px; } /* 鼠标悬停在标签上时的样式 */ QTabBar::tab:hover { - background-color: #3a3a4a; /* 悬停时使用稍亮的背景色 */ + background-color: #596276; } /* 当前选中的标签页的样式 */ QTabBar::tab:selected { - background-color: #252538; /* 选中时使用 Dock 背景色 */ - color: #ffffff; /* 选中时使用更亮的文字颜色 */ - font-weight: bold; /* 字体加粗 */ - border-color: #3a3a4a; - border-bottom: 2px solid #8b5cf6; /* 选中标签的底部高亮线 */ + background-color: #3067c0; + color: #ffffff; + font-weight: 500; + border-color: #4c5c6e; + border-bottom: 2px solid #3067c0; } /* 未选中的标签 */ QTabBar::tab:!selected { - margin-top: 2px; /* 未选中标签稍微下移,创建层次感 */ + margin-top: 2px; } /* 标签栏底部的线条 */ QTabBar::tab-bar { alignment: left; - border: none; /* 移除标签栏边框 */ + border: none; } """ @@ -1689,27 +1799,27 @@ class MainWindow(QMainWindow): self.scriptsList = QListWidget() self.scriptsList.setStyleSheet(""" QListWidget { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; - alternate-background-color: #252538; - selection-background-color: rgba(139, 92, 246, 100); - selection-color: white; + background-color: #19191b; + color: #ebebeb; + border: none; + alternate-background-color: #19191b; + selection-background-color: rgba(48, 103, 192, 0.4); + selection-color: #ffffff; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; + outline: none; } QListWidget::item { padding: 6px 8px; - border-bottom: 1px solid #2d2d44; - } - QListWidget::item:last-child { - border-bottom: none; + border: none; } QListWidget::item:hover { - background-color: #3a3a4a; + background-color: rgba(89, 100, 113, 0.3); } QListWidget::item:selected { - background-color: rgba(139, 92, 246, 120); - color: white; + background-color: rgba(48, 103, 192, 0.4); + color: #ffffff; } """) self.scriptsList.itemDoubleClicked.connect(self.onScriptDoubleClick) @@ -1757,28 +1867,28 @@ class MainWindow(QMainWindow): self.mountedScriptsList = QListWidget() self.mountedScriptsList.setStyleSheet(""" QListWidget { - background-color: #1e1e2e; - color: #e0e0ff; - border: 1px solid #3a3a4a; - border-radius: 4px; - alternate-background-color: #252538; - selection-background-color: rgba(139, 92, 246, 100); - selection-color: white; + background-color: #19191b; + color: #ebebeb; + border: none; + alternate-background-color: #19191b; + selection-background-color: rgba(48, 103, 192, 0.4); + selection-color: #ffffff; max-height: 120px; + font-family: 'Microsoft YaHei', 'Inter', sans-serif; + font-size: 10px; + font-weight: 300; + outline: none; } QListWidget::item { padding: 4px 8px; - border-bottom: 1px solid #2d2d44; - } - QListWidget::item:last-child { - border-bottom: none; + border: none; } QListWidget::item:hover { - background-color: #3a3a4a; + background-color: rgba(89, 100, 113, 0.3); } QListWidget::item:selected { - background-color: rgba(139, 92, 246, 120); - color: white; + background-color: rgba(48, 103, 192, 0.4); + color: #ffffff; } """) self.mountedScriptsList.setMaximumHeight(100)