Skip to content

Commit dba9578

Browse files
committed
refactor(FB_status.py): 重构FB_status样式布局
1 parent db76443 commit dba9578

1 file changed

Lines changed: 30 additions & 33 deletions

File tree

facebook/FB_status.py

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def initUI(self):
228228
title_container = QWidget()
229229
title_container.setFixedHeight(40) # 设置标题栏高度
230230
title_container.setStyleSheet(
231-
"background-color: #fce3c2; border-top-left-radius: 8px; border-top-right-radius: 8px;")
231+
"background-color: #e0e5e0; border-top-left-radius: 8px; border-top-right-radius: 8px;")
232232

233233
title_bar = QHBoxLayout(title_container)
234234
title_bar.setContentsMargins(15, 0, 15, 0)
@@ -240,43 +240,38 @@ def initUI(self):
240240
title_bar.addStretch(1) # 添加弹性空间
241241

242242
# 最小化按钮
243-
min_button = QPushButton("", self) # 修改:使用减号字符
243+
min_button = QPushButton("-", self) # 使用减号字符
244244
min_button.setFixedSize(20, 20)
245-
min_button.setFont(QFont("Arial", 12, QFont.Bold))
245+
min_button.setFont(QFont("微軟雅黑", 12))
246246
min_button.clicked.connect(self.showMinimized)
247247
min_button.setStyleSheet("""
248248
QPushButton {
249-
background-color: #f7b36a;
250-
color: white;
249+
background-color: transparent;
250+
color: #333333;
251+
border: 1px solid #ccc;
251252
border-radius: 10px;
252-
border: none;
253253
}
254254
QPushButton:hover {
255-
background-color: #fce3c2;
256-
}
257-
QPushButton:pressed {
258-
background-color: #4a3aac;
255+
background-color: #f0f0f0;
259256
}
260257
""")
261258
title_bar.addWidget(min_button)
262259

263260
# 关闭按钮
264-
close_button = QPushButton("", self) # 修改:使用乘号字符
261+
close_button = QPushButton("×", self) # 使用乘号字符
265262
close_button.setFixedSize(20, 20)
266-
close_button.setFont(QFont("Arial", 12, QFont.Bold))
263+
close_button.setFont(QFont("微軟雅黑", 12))
267264
close_button.clicked.connect(self.close)
268265
close_button.setStyleSheet("""
269266
QPushButton {
270-
background-color: #f7b36a;
271-
color: white;
267+
background-color: transparent;
268+
color: #333333;
269+
border: 1px solid #ccc;
272270
border-radius: 10px;
273-
border: none;
274271
}
275272
QPushButton:hover {
276-
background-color: #ff5252;
277-
}
278-
QPushButton:pressed {
279-
background-color: #ff3838;
273+
background-color: #ff4d4f;
274+
color: white;
280275
}
281276
""")
282277
title_bar.addWidget(close_button)
@@ -297,27 +292,29 @@ def initUI(self):
297292
scroll_area.setFrameShape(QFrame.NoFrame) # 无边框
298293
scroll_area.setStyleSheet("""
299294
QScrollArea {
300-
background-color: #8b8b8b;
295+
background-color: white;
301296
border: none;
302297
border-bottom-left-radius: 8px;
303298
border-bottom-right-radius: 8px;
304299
}
305300
QScrollBar:vertical {
306301
border: none;
307302
background: #f0f0f0;
308-
width: 10px;
303+
width: 12px;
309304
margin: 0px;
310-
border-radius: 5px;
305+
border-radius: 6px;
311306
}
312307
QScrollBar::handle:vertical {
313-
background: #fce3c2;
308+
background: #c0c0c0;
314309
min-height: 20px;
315-
border-radius: 5px;
310+
border-radius: 6px;
316311
}
317312
QScrollBar::handle:vertical:hover {
318-
background: #a89cf9;
313+
background: #a0a0a0;
319314
}
320315
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
316+
border: none;
317+
background: none;
321318
height: 0px;
322319
}
323320
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
@@ -327,9 +324,9 @@ def initUI(self):
327324

328325
# 创建内容容器
329326
content_widget = QWidget()
330-
content_widget.setStyleSheet("background-color: #fffaf2;")
327+
content_widget.setStyleSheet("background-color: white;")
331328
content_layout = QVBoxLayout(content_widget)
332-
content_layout.setContentsMargins(15, 10, 15, 15)
329+
content_layout.setContentsMargins(20, 15, 20, 15)
333330
content_layout.setAlignment(Qt.AlignTop)
334331

335332
# 状态文本区域
@@ -338,11 +335,11 @@ def initUI(self):
338335
self.status_textedit.setFont(QFont("微軟雅黑", 10))
339336
self.status_textedit.setStyleSheet("""
340337
QTextEdit {
341-
color: #3c9d6d;
342-
background-color: #ffffff;
338+
color: #333333;
339+
background-color: white;
343340
border: none;
344-
border-radius: 10px;
345-
border: 2px dashed #f9ecdb;
341+
border: 2px dashed #ffe0e0;
342+
border-radius: 4px;
346343
padding: 10px;
347344
font-size: 14px;
348345
}
@@ -358,9 +355,9 @@ def initUI(self):
358355

359356
self.setLayout(layout)
360357

361-
# 设置暗色主题
358+
# 设置亮色主题
362359
palette = QPalette()
363-
palette.setColor(QPalette.Window, QColor(255, 250, 242))
360+
palette.setColor(QPalette.Window, QColor(255, 255, 255))
364361
palette.setColor(QPalette.WindowText, QColor(51, 51, 51))
365362
palette.setColor(QPalette.Base, QColor(255, 255, 255))
366363
self.setPalette(palette)

0 commit comments

Comments
 (0)