Gui: Use our own ToolBar class in all places

This commit is contained in:
Kacper Donat
2024-06-15 15:08:01 +02:00
parent 214322665b
commit e04b28e66d
7 changed files with 33 additions and 12 deletions

View File

@@ -117,7 +117,7 @@ def setStatusIcons(show=True):
if statuswidget:
statuswidget.show()
else:
statuswidget = QtGui.QToolBar()
statuswidget = FreeCADGui.UiLoader().createWidget("Gui::ToolBar")
statuswidget.setObjectName("BIMStatusWidget")
s = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/General").GetInt("ToolbarIconSize", 24)
statuswidget.setIconSize(QtCore.QSize(s,s))

View File

@@ -106,7 +106,7 @@ class BIM_IfcExplorer:
self.dialog.setObjectName("IfcExplorer")
self.dialog.setWindowTitle(translate("BIM", "Ifc Explorer"))
self.dialog.resize(720, 540)
toolbar = QtGui.QToolBar()
toolbar = FreeCADGui.UiLoader().createWidget("Gui::ToolBar")
layout = QtGui.QVBoxLayout(self.dialog)
layout.addWidget(toolbar)

View File

@@ -81,7 +81,7 @@ class BIM_Views:
size = FreeCAD.ParamGet(
"User parameter:BaseApp/Preferences/General"
).GetInt("ToolbarIconSize", 24)
toolbar = QtGui.QToolBar()
toolbar = FreeCADGui.UiLoader().createWidget("Gui::ToolBar")
toolbar.setIconSize(QtCore.QSize(size, size))
dialog.horizontalLayout.addWidget(toolbar)
for button in [

View File

@@ -205,7 +205,7 @@ class DraftToolBar:
# add only a dummy widget, since widgets are created on demand
self.baseWidget = DraftBaseWidget()
self.tray = QtWidgets.QToolBar(None)
self.tray = FreeCADGui.UiLoader().createWidget("Gui::ToolBar")
self.tray.setObjectName("Draft tray")
self.tray.setWindowTitle("Draft tray")
self.toptray = self.tray