提交 6af6c121 编写于 作者: 之一Yo's avatar 之一Yo

fixes #32

上级 0295d764
......@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/ma
:license: MIT, see LICENSE for more details.
"""
__version__ = "0.3.4"
__version__ = "0.3.5"
from .components import *
from .common import *
......
此差异已折叠。
......@@ -190,6 +190,7 @@ class RoundMenu(QWidget):
self.hBoxLayout = QHBoxLayout(self)
self.view = MenuActionListWidget(self)
self.ani = QPropertyAnimation(self, b'pos', self)
self.timer = QTimer(self)
self.__initWidgets()
def __initWidgets(self):
......@@ -198,6 +199,10 @@ class RoundMenu(QWidget):
self.setAttribute(Qt.WA_TranslucentBackground)
self.setMouseTracking(True)
self.timer.setSingleShot(True)
self.timer.setInterval(400)
self.timer.timeout.connect(self._onShowMenuTimeOut)
self.setShadowEffect()
self.hBoxLayout.addWidget(self.view, 1, Qt.AlignCenter)
......@@ -413,7 +418,8 @@ class RoundMenu(QWidget):
self.lastHoverItem = item
self.lastHoverSubMenuItem = item
# delay 400 ms to anti-shake
QTimer.singleShot(400, self._onShowMenuTimeOut)
self.timer.stop()
self.timer.start()
def _onShowMenuTimeOut(self):
if self.lastHoverSubMenuItem is None or not self.lastHoverItem is self.lastHoverSubMenuItem:
......@@ -458,6 +464,7 @@ class RoundMenu(QWidget):
def _closeParentMenu(self):
menu = self
while menu.parentMenu:
menu.close()
menu = menu.parentMenu
menu.close()
......
......@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools.setup(
name="PyQt-Fluent-Widgets",
version="0.3.4",
version="0.3.5",
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.
先完成此消息的编辑!
想要评论请 注册