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

修复命令栏自定义部件没有垂直居中的问题 (#324)

上级 f84d9b0e
......@@ -357,9 +357,8 @@ class CommandBar(QFrame):
for widget in visibles:
widget.show()
w, h = widget.width(), widget.height()
widget.move(x, (h - widget.height()) // 2)
x += (w + self.spacing())
x += (widget.width() + self.spacing())
# show more actions button
if self._hiddenActions or len(visibles) < len(self._widgets):
......@@ -370,7 +369,7 @@ class CommandBar(QFrame):
widget.hide()
self._hiddenWidgets.append(widget)
def _visibleWidgets(self) -> List[QLayoutItem]:
def _visibleWidgets(self) -> List[QWidget]:
""" return the visible widgets in layout """
# have enough spacing to show all widgets
if self.suitableWidth() <= self.width():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册