Add button to toggle toolbar text

This commit is contained in:
David Vierra 2015-09-14 16:51:39 -10:00
parent 48e71161f0
commit c804a5e945

View File

@ -119,6 +119,21 @@ class MCEditApp(QtGui.QApplication):
log.info("Loaded main window.")
def toggleToolbarText(enable):
if enable:
style = Qt.ToolButtonTextUnderIcon
else:
style = Qt.ToolButtonIconOnly
self.mainWindow.toolsToolBar.setToolButtonStyle(style)
self.mainWindow.panelsToolBar.setToolButtonStyle(style)
self.toggleToolbarTextAction = QtGui.QAction("Toolbar Text", self)
self.toggleToolbarTextAction.setCheckable(True)
self.toggleToolbarTextAction.setChecked(True)
self.toggleToolbarTextAction.toggled.connect(toggleToolbarText)
self.toggleToolbarTextAction.__toggled = toggleToolbarText
# --- OpenGL ---
setDefaultFormat()
@ -488,6 +503,8 @@ class MCEditApp(QtGui.QApplication):
:type session: EditorSession
"""
self.mainWindow.panelsToolBar.clear()
self.mainWindow.panelsToolBar.addAction(self.toggleToolbarTextAction)
self.mainWindow.toolsToolBar.clear()
self.removeSessionDockWidgets()