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

修复导航栏自定义导航部件没有居中的问题 (#388)

上级 45fdab22
......@@ -269,13 +269,13 @@ class NavigationBar(QWidget):
""" insert widget to layout """
if position == NavigationItemPosition.TOP:
widget.setParent(self)
self.topLayout.insertWidget(index, widget, 0, Qt.AlignTop)
self.topLayout.insertWidget(index, widget, 0, Qt.AlignTop | Qt.AlignHCenter)
elif position == NavigationItemPosition.SCROLL:
widget.setParent(self.scrollWidget)
self.scrollLayout.insertWidget(index, widget, 0, Qt.AlignTop)
self.scrollLayout.insertWidget(index, widget, 0, Qt.AlignTop | Qt.AlignHCenter)
else:
widget.setParent(self)
self.bottomLayout.insertWidget(index, widget, 0, Qt.AlignBottom)
self.bottomLayout.insertWidget(index, widget, 0, Qt.AlignBottom | Qt.AlignHCenter)
widget.show()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册