FreeCAD-macros
46 строк · 1.6 Кб
1# Reset Toolbars position
2# Author: Milos Petrasinovic <mpetrasinovic@protors.co>
3# PROTORS, Belgrade, Serbia
4# info@protors.co
5#
6# --------------------
7#
8# Copyright (C) 2020 PROTORS <info@protors.co>
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Lesser General Public License as
12# published by the Free Software Foundation, either version 3 of the
13# License, or (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Lesser General Public License for more details.
19#
20# You should have received a copy of the GNU Lesser General Public License
21# along with this program. If not, see <https://www.gnu.org/licenses/>.
22#
23# --------------------
24
25__Name__ = 'GuiResetToolbars'
26__Comment__ = 'Reset Toolbars position'
27__Author__ = 'PROTORS'
28__Version__ = '1.0.0'
29__Date__ = '2020-04-21'
30__License__ = 'LGPL-3.0-or-later'
31__Web__ = "https://github.com/protors/ResetToolbars/"
32__Wiki__ = 'https://wiki.freecadweb.org/Macro_GuiResetToolbars'
33__Icon__ = 'GuiResetToolbars.svg'
34__Help__ = 'Run the macro within a workbench that has missing toolbar(s)'
35__Status__ = 'stable'
36__Requires__ = 'Freecad >= 0.18.4'
37__Communication__ = 'https://github.com/protors/ResetToolbars/issues/'
38__Files__ = 'GuiResetToolbars.svg'
39
40import FreeCADGui as gui
41from PySide import QtGui, QtCore # FreeCAD's special PySide!
42
43mw = gui.getMainWindow()
44tb = mw.findChildren(QtGui.QToolBar)
45for i in tb:
46mw.addToolBar(QtCore.Qt.TopToolBarArea, i)
47