提交 80551f82 编写于 作者: 之一Yo's avatar 之一Yo

修复右击菜单的弹出位置问题

上级 019b6612
...@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/ma ...@@ -12,7 +12,7 @@ Examples are available at https://github.com/zhiyiYo/PyQt-Fluent-Widgets/tree/ma
:license: GPLv3, see LICENSE for more details. :license: GPLv3, see LICENSE for more details.
""" """
__version__ = "0.6.4" __version__ = "0.6.5"
from .components import * from .components import *
from .common import * from .common import *
......
...@@ -206,7 +206,6 @@ class RoundMenu(QWidget): ...@@ -206,7 +206,6 @@ class RoundMenu(QWidget):
self.setShadowEffect() self.setShadowEffect()
self.hBoxLayout.addWidget(self.view, 1, Qt.AlignCenter) self.hBoxLayout.addWidget(self.view, 1, Qt.AlignCenter)
self.hBoxLayout.setSizeConstraint(QHBoxLayout.SetMinimumSize)
self.hBoxLayout.setContentsMargins(12, 8, 12, 20) self.hBoxLayout.setContentsMargins(12, 8, 12, 20)
FluentStyleSheet.MENU.apply(self) FluentStyleSheet.MENU.apply(self)
...@@ -237,6 +236,12 @@ class RoundMenu(QWidget): ...@@ -237,6 +236,12 @@ class RoundMenu(QWidget):
self.menuItem = item self.menuItem = item
self.isSubMenu = True if parent else False self.isSubMenu = True if parent else False
def adjustSize(self):
m = self.layout().contentsMargins()
w = self.view.width() + m.left() + m.right()
h = self.view.height() + m.top() + m.bottom()
self.setFixedSize(w, h)
def icon(self): def icon(self):
return self._icon return self._icon
......
...@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f: ...@@ -6,7 +6,7 @@ with open('README.md', encoding='utf-8') as f:
setuptools.setup( setuptools.setup(
name="PyQt-Fluent-Widgets", name="PyQt-Fluent-Widgets",
version="0.6.4", version="0.6.5",
keywords="pyqt fluent widgets", keywords="pyqt fluent widgets",
author="zhiyiYo", author="zhiyiYo",
author_email="shokokawaii@outlook.com", author_email="shokokawaii@outlook.com",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册