Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
Oil_Level_Recognition_System
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Oil_Level_Recognition_System
Commits
25bb16b1
Commit
25bb16b1
authored
Nov 30, 2025
by
liuqingjun2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
1a843a9c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
style_manager.py
widgets/style_manager.py
+21
-0
No files found.
widgets/style_manager.py
View file @
25bb16b1
...
@@ -295,6 +295,9 @@ class DialogManager:
...
@@ -295,6 +295,9 @@ class DialogManager:
# 🔥 根据文本内容自动调整对话框大小
# 🔥 根据文本内容自动调整对话框大小
DialogManager
.
_adjust_dialog_size
(
msg_box
,
message
)
DialogManager
.
_adjust_dialog_size
(
msg_box
,
message
)
# 🔥 应用统一按钮样式到对话框的所有按钮
DialogManager
.
_apply_button_styles
(
msg_box
)
return
msg_box
return
msg_box
@staticmethod
@staticmethod
...
@@ -357,6 +360,24 @@ class DialogManager:
...
@@ -357,6 +360,24 @@ class DialogManager:
pass
pass
@staticmethod
@staticmethod
def
_apply_button_styles
(
msg_box
):
"""应用统一按钮样式到对话框的所有按钮
Args:
msg_box: QMessageBox对象
"""
try
:
# 查找对话框中的所有QPushButton
buttons
=
msg_box
.
findChildren
(
QtWidgets
.
QPushButton
)
for
button
in
buttons
:
# 应用TextButtonStyleManager样式
TextButtonStyleManager
.
applyToButton
(
button
)
except
Exception
as
e
:
pass
@staticmethod
def
_set_chinese_button_texts
(
msg_box
,
button_texts
=
None
):
def
_set_chinese_button_texts
(
msg_box
,
button_texts
=
None
):
"""设置按钮为中文文本"""
"""设置按钮为中文文本"""
# 默认中文按钮文本映射
# 默认中文按钮文本映射
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment