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

fixes #10

上级 726f9398
...@@ -10,7 +10,7 @@ online at https://pyqt-fluent-widgets.readthedocs.io. ...@@ -10,7 +10,7 @@ online at https://pyqt-fluent-widgets.readthedocs.io.
:license: MIT, see LICENSE for more details. :license: MIT, see LICENSE for more details.
""" """
__version__ = "0.2.4" __version__ = "0.2.5"
from .components import * from .components import *
from .common import * from .common import *
......
...@@ -122,6 +122,9 @@ class ComboBox(QPushButton): ...@@ -122,6 +122,9 @@ class ComboBox(QPushButton):
self._showComboMenu() self._showComboMenu()
def _showComboMenu(self): def _showComboMenu(self):
if not self.items:
return
menu = ComboBoxMenu(self) menu = ComboBoxMenu(self)
for i, item in enumerate(self.items): for i, item in enumerate(self.items):
menu.addAction( menu.addAction(
......
...@@ -554,10 +554,10 @@ class RoundMenu(QWidget): ...@@ -554,10 +554,10 @@ class RoundMenu(QWidget):
if self.isVisible(): if self.isVisible():
return return
desktop = QApplication.desktop().availableGeometry() rect = QApplication.screenAt(QCursor.pos()).availableGeometry()
w, h = self.width() + 20, self.height() + 20 w, h = self.width() + 5, self.height() + 5
pos.setX(max(10, min(pos.x() - self.layout().contentsMargins().left(), desktop.width() - w))) pos.setX(max(10, min(pos.x() - self.layout().contentsMargins().left(), rect.right() - w)))
pos.setY(max(10, min(pos.y() - 4, desktop.height() - h))) pos.setY(max(10, min(pos.y() - 4, rect.bottom() - h)))
if ani: if ani:
self.ani.setStartValue(pos-QPoint(0, h/2)) self.ani.setStartValue(pos-QPoint(0, h/2))
......
...@@ -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.2.4", version="0.2.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.
先完成此消息的编辑!
想要评论请 注册