Skip to content

Commit 90870fd

Browse files
committed
feat(ui): 更新任务执行顺序界面UI样式和图片
Signed-off-by: LiggMax <wenzhouli06@gmail.com>
1 parent b07caaa commit 90870fd

1 file changed

Lines changed: 17 additions & 21 deletions

File tree

FBver/FB_lists.py

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import asyncio
21
import sys
32
import os
3+
import sys
4+
5+
from PyQt5 import QtCore
6+
from PyQt5.QtCore import Qt, QMimeData, QByteArray, QDataStream, QIODevice
7+
from PyQt5.QtGui import QDrag, QColor, QFont, QPalette, QPainter, QIcon, QPen
48
from PyQt5.QtWidgets import (QApplication, QWidget, QVBoxLayout, QHBoxLayout,
59
QLabel, QPushButton, QFrame, QMessageBox, QScrollArea,
610
QSizePolicy, QGridLayout, QMenu, QInputDialog, QDialog)
7-
from PyQt5.QtCore import Qt, QMimeData, QByteArray, QDataStream, QIODevice, QPoint, QEventLoop
8-
from PyQt5.QtGui import QDrag, QColor, QFont, QPalette, QCursor, QPainter, QIcon, QPen
9-
from PyQt5 import QtCore
10-
from qasync import asyncSlot
1111

1212

1313
def resource_path(relative_path):
@@ -87,7 +87,7 @@ def leaveEvent(self, event):
8787

8888
def getDarkerColor(self):
8989
"""获取更深的颜色用于悬停效果"""
90-
colors = ["#165dff", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
90+
colors = ["#82c3ec", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
9191
original_color = colors[self.index]
9292
# 简单的颜色变暗处理
9393
if original_color.startswith('#'):
@@ -102,7 +102,7 @@ def getDarkerColor(self):
102102

103103
def getOriginalColor(self):
104104
"""获取原始颜色"""
105-
colors = ["#165dff", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
105+
colors = ["#82c3ec", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
106106
return colors[self.index]
107107

108108
def mousePressEvent(self, event):
@@ -256,7 +256,7 @@ def dropEvent(self, event):
256256
self.labels.pop(i)
257257

258258
# 创建新标签并添加到相同位置
259-
colors = ["#165dff", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
259+
colors = ["#82c3ec", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
260260
texts = ["循環發文", "循環推文", "循環加社團", "養號", "粉絲專頁", "休息時間"]
261261
new_label = DraggableLabel(index, colors[index], texts[index], draggable=True)
262262
new_label.is_internal = True # 标记为内部标签
@@ -308,7 +308,7 @@ def dropEvent(self, event):
308308
self.swapLabels(source_index, target_index)
309309
else:
310310
# 外部拖动:插入新标签并移除目标标签
311-
colors = ["#165dff", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
311+
colors = ["#82c3ec", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
312312
texts = ["循環發文", "循環推文", "循環加社團", "養號", "粉絲專頁", "休息時間"]
313313

314314
# 移除目标位置的标签
@@ -344,7 +344,7 @@ def dropEvent(self, event):
344344
self.labels.insert(target_index, new_label)
345345
else:
346346
# 添加到末尾
347-
colors = ["#165dff", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
347+
colors = ["#82c3ec", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
348348
texts = ["循環發文", "循環推文", "循環加社團", "養號", "粉絲專頁", "休息時間"]
349349
new_label = DraggableLabel(index, colors[index], texts[index], draggable=True)
350350
new_label.is_internal = True # 标记为内部标签
@@ -574,26 +574,25 @@ def __init__(self, config=None, parent=None): # 添加 config 参数
574574

575575
def initUI(self):
576576
# 设置窗口背景颜色
577-
self.setStyleSheet("background-color: #e6f0ff; color: white;")
577+
self.setStyleSheet("background-color: #f8fafc; color: white;")
578578

579579
main_layout = QVBoxLayout()
580580
main_layout.setContentsMargins(0, 0, 0, 0)
581581
main_layout.setSpacing(0)
582582

583583
# 创建自定义标题栏
584584
title_bar = QWidget()
585-
title_bar.setFixedHeight(30)
585+
title_bar.setFixedHeight(50)
586586
title_bar.setStyleSheet("""
587587
background-color: #e6f0ff;
588588
border-top-left-radius: 5px;
589589
border-top-right-radius: 5px;
590-
border-bottom:1px solid #739bff;
591590
""")
592591
title_bar_layout = QHBoxLayout(title_bar)
593592
title_bar_layout.setContentsMargins(10, 0, 5, 0)
594593

595594
self.title_label = QLabel("任務執行順序")
596-
self.title_label.setStyleSheet("color: #739bff;") # 改为黑色字体
595+
self.title_label.setStyleSheet("color: #88c5ec;")
597596
self.title_label.setFont(QFont("微軟雅黑", 10, QFont.Bold))
598597
title_bar_layout.addWidget(self.title_label)
599598
title_bar_layout.addStretch(1)
@@ -653,7 +652,7 @@ def initUI(self):
653652

654653
# 右侧可拖拽标签区域
655654
right_panel = QFrame()
656-
right_panel.setStyleSheet("background-color: #e6f0ff;")
655+
right_panel.setStyleSheet("background-color: #f8fafc;")
657656
right_layout = QVBoxLayout(right_panel)
658657
right_layout.setContentsMargins(10, 10, 10, 10)
659658

@@ -664,7 +663,7 @@ def initUI(self):
664663
right_layout.addWidget(label)
665664

666665
# 创建4个可拖拽的标签,但根据配置决定是否显示
667-
colors = ["#165dff", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
666+
colors = ["#82c3ec", "#a5d6a7", "#ffe0b2", "#DDA0DD", "#f8bbd0", "#9fa8da"]
668667
texts = ["循環發文", "循環推文", "循環加社團", "養號", "粉絲專頁", "休息時間"]
669668

670669
# 根据配置决定哪些标签应该显示
@@ -723,7 +722,7 @@ def initUI(self):
723722
self.clear_btn.setFixedWidth(self.clear_btn.fontMetrics().width("清空任務") + 20)
724723
self.clear_btn.setStyleSheet("""
725724
QPushButton {
726-
background-color: #ff6b6b;
725+
background-color: #f8b4b4;
727726
color: white;
728727
border: none;
729728
padding: 8px;
@@ -740,7 +739,7 @@ def initUI(self):
740739
save_btn.setFixedWidth(save_btn.fontMetrics().width("保存順序") + 20)
741740
save_btn.setStyleSheet("""
742741
QPushButton {
743-
background-color: #63b5ff;
742+
background-color: #6fb8db;
744743
color: white;
745744
border: none;
746745
padding: 8px;
@@ -767,11 +766,8 @@ def initUI(self):
767766
QLabel {
768767
color: #99989e;
769768
font-size: 12px;
770-
background-color: #f5f0ff;
771769
padding: 5px;
772-
border: 1px solid #f5f0ff;
773770
border-radius: 5px;
774-
775771
}
776772
""")
777773
guide_text.setWordWrap(True) # 允许文本换行

0 commit comments

Comments
 (0)