Macro GuiResetToolbars: Difference between revisions

From FreeCAD Documentation
No edit summary
m (Description)
Line 2: Line 2:
<translate>
<translate>


<!--T:1-->
{{Macro
{{Macro
|Name=GuiResetToolbars
|Name=GuiResetToolbars
|Description=This macro resets the position of the toolbars. Run the macro within a workbench that has a missing toolbar(s).
|Description=Reset Toolbars position.
|Author=PROTORS
|Author=PROTORS
|Download=[https://wiki.freecadweb.org/images/f/f8/GuiResetToolbars.svg ToolBar Icon]
|Download=[https://wiki.freecadweb.org/images/f/f8/GuiResetToolbars.svg ToolBar Icon]
Line 14: Line 13:
}}
}}


==Description==
==Usage==<!--T:2-->


This macro resets the position of the toolbars.
<!--T:3-->
This macro resets the position of the toolbars. Run the macro within a workbench that has a missing toolbar(s).


==Usage==
==Script== <!--T:4-->

Run the macro within a workbench that has a missing toolbar(s).

==Script==
</translate>
</translate>


Line 74: Line 76:
mw.addToolBar(QtCore.Qt.TopToolBarArea, i)
mw.addToolBar(QtCore.Qt.TopToolBarArea, i)
}}
}}
<translate>

==Links==

The forum discussion [https://forum.freecadweb.org/viewtopic.php?f=3&t=45452&p=390034#p389404 Reset toolbar position]

</translate>

Revision as of 13:35, 26 April 2020

Other languages:

GuiResetToolbars

Description
This macro resets the position of the toolbars. Run the macro within a workbench that has a missing toolbar(s).

Macro version: 1.0.0
Last modified: 2020-04-21
FreeCAD version: 0.18.4 and above
Download: ToolBar Icon
Author: PROTORS
Author
PROTORS
Download
ToolBar Icon
Links
Macro Version
1.0.0
Date last modified
2020-04-21
FreeCAD Version(s)
0.18.4 and above
Default shortcut
None
See also
Github repository

Description

This macro resets the position of the toolbars.

Usage

Run the macro within a workbench that has a missing toolbar(s).

Script

ToolBar Icon

GuiResetToolbars.FCMacro

# Reset Toolbars position
# Author: Milos Petrasinovic <mpetrasinovic@protors.co>
# PROTORS, Belgrade, Serbia
# info@protors.co
# 
# --------------------
#
# Copyright (C) 2020 PROTORS <info@protors.co>
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as 
# published by the Free Software Foundation, either version 3 of the 
# License, or (at your option) any later version.
#  
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#  
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# --------------------

__Name__ = 'GuiResetToolbars'
__Comment__ = 'Reset Toolbars position'
__Author__ = 'PROTORS'
__Version__ = '1.0.0'
__Date__ = '2020-04-21'
__License__ = 'LGPL-3.0-or-later'
__Web__ = "https://github.com/protors/ResetToolbars/"
__Wiki__ = 'https://wiki.freecadweb.org/Macro_GuiResetToolbars'
__Icon__ = 'GuiResetToolbars.svg'
__Help__ = 'Run the macro within a workbench that has missing toolbar(s)'
__Status__ = 'stable'
__Requires__ = 'Freecad >= 0.18.4'
__Communication__ = 'https://github.com/protors/ResetToolbars/issues/'
__Files__ = 'GuiResetToolbars.svg'

import FreeCADGui as gui
from PySide import QtGui, QtCore # FreeCAD's special PySide!

mw = gui.getMainWindow()
tb = mw.findChildren(QtGui.QToolBar)
for i in tb:
    mw.addToolBar(QtCore.Qt.TopToolBarArea, i)

Links

The forum discussion Reset toolbar position