Skip to content

Commit

Permalink
fix: duplicate toolbar icons #37
Browse files Browse the repository at this point in the history
  • Loading branch information
knipknap committed Dec 8, 2024
1 parent 2594eb9 commit e71e7e3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions btl/ui/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@ def on_workbench_activated(workbench):
return

# Create a toolbar if it does not yet exist.
toolbar = QtGui.QToolBar(mw)
toolbar.setObjectName(TOOLBAR_NAME)
mw.addToolBar(toolbar)

# Add the library editor button.
tool_button = QtGui.QToolButton(mw)
tool_button.setIcon(QtGui.QPixmap(ICON_FILE))
tool_button.clicked.connect(on_library_open_clicked)
toolbar.addWidget(tool_button)
toolbar = mw.findChild(QtGui.QToolBar, TOOLBAR_NAME)
if not toolbar:
toolbar = QtGui.QToolBar(mw)
toolbar.setObjectName(TOOLBAR_NAME)
mw.addToolBar(toolbar)

# Add the library editor button.
tool_button = QtGui.QToolButton(mw)
tool_button.setIcon(QtGui.QPixmap(ICON_FILE))
tool_button.clicked.connect(on_library_open_clicked)
toolbar.addWidget(tool_button)

# Hack: Replace FreeCAD tool library by BTL by monkey-patching
# the path workbench.
Expand Down

0 comments on commit e71e7e3

Please sign in to comment.