提交 8818cf13 编写于 作者: 之一Yo's avatar 之一Yo

无边框消息框添加隐藏标题栏的功能

上级 4ae0a0c0
......@@ -22,6 +22,7 @@ class Demo(QWidget):
title = 'Are you sure you want to delete the folder?'
content = """If you delete the "Music" folder from the list, the folder will no longer appear in the list, but will not be deleted."""
w = Dialog(title, content, self)
# w.setTitleBarVisible(False)
if w.exec():
print('Yes button is pressed')
else:
......
......@@ -52,7 +52,7 @@ class Ui_MessageBox:
if self.isWindow():
if self.parent():
w = max(self.titleLabel.width(), self.parent().width())
chars = max(min(w / 9, 100), 30)
chars = max(min(w / 9, 140), 30)
else:
chars = 100
else:
......@@ -120,6 +120,9 @@ class Dialog(FramelessDialog, Ui_MessageBox):
FluentStyleSheet.DIALOG.apply(self)
self.setFixedSize(self.size())
def setTitleBarVisible(self, isVisible: bool):
self.windowTitleLabel.setVisible(isVisible)
class MessageBox(MaskDialogBase, Ui_MessageBox):
""" Message box """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册