Commit 25bb16b1 by liuqingjun2

1

parent 1a843a9c
...@@ -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):
"""设置按钮为中文文本""" """设置按钮为中文文本"""
# 默认中文按钮文本映射 # 默认中文按钮文本映射
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment