提交 5aa049ee 编写于 作者: 之一Yo's avatar 之一Yo

调整无边框对话框样式,添加创建提示条类方法

上级 882810b9
......@@ -257,13 +257,11 @@ class SettingInterface(ScrollArea):
def __showRestartTooltip(self):
""" show restart tooltip """
w = ToastToolTip(
ToastToolTip.warn(
self.tr('Configuration updated successfully'),
self.tr('Configuration takes effect after restart'),
'info',
self.window()
)
w.show()
def __onDeskLyricFontCardClicked(self):
""" desktop lyric font button clicked slot """
......
......@@ -10,7 +10,7 @@ online at https://pyqt-fluent-widgets.readthedocs.io.
:license: MIT, see LICENSE for more details.
"""
__version__ = "0.2.6"
__version__ = "0.2.7"
from .components import *
from .common import *
......
......@@ -8,8 +8,6 @@ QDialog {
border-left: none;
border-right: none;
border-bottom: none;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
QLabel {
......
......@@ -8,8 +8,6 @@ QDialog {
border-left: none;
border-right: none;
border-bottom: none;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
QLabel {
......
此差异已折叠。
......@@ -146,6 +146,9 @@ class StateToolTip(QWidget):
class ToastToolTip(QWidget):
""" Toast tooltip """
SUCCESS = "completed"
WARNING = "info"
def __init__(self, title: str, content: str, icon: str, parent=None):
"""
Parameters
......@@ -253,3 +256,13 @@ class ToastToolTip(QWidget):
self.slideAni.start()
super().showEvent(e)
self.closeTimer.start()
@classmethod
def success(cls, title: str, content: str, parent=None):
""" show a success toast """
cls(title, content, cls.SUCCESS, parent).show()
@classmethod
def warn(cls, title: str, content: str, parent=None):
""" show a warning toast """
cls(title, content, cls.WARNING, parent).show()
\ No newline at end of file
......@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools.setup(
name="PyQt-Fluent-Widgets",
version="0.2.6",
version="0.2.7",
keywords="pyqt fluent widgets",
author="zhiyiYo",
author_email="shokokawaii@outlook.com",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册