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

fixes #10

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