From 677c8ced9fe10fcd57090837a0ae415c0f3254c6 2011-09-15 06:03:42 From: Matthias BUSSONNIER Date: 2011-09-15 06:03:42 Subject: [PATCH] add fullscreen support for QtConsole throught shortcut add a toggleFullscreen action to qtconsoleapp and connect it to the 'Ctrl+Meta+Space' shortcut (which is Command+Ctrl+Space on Mac) add shortcut description in %guiref move maximize and minimize shortcut/fonction to another branch --- diff --git a/IPython/core/usage.py b/IPython/core/usage.py index 42704fa..b11181c 100644 --- a/IPython/core/usage.py +++ b/IPython/core/usage.py @@ -416,6 +416,7 @@ The keybindings themselves are: - ``C-.``: force a kernel restart (a confirmation dialog appears). - ``C-+``: increase font size. - ``C--``: decrease font size. +- ``C-M-Space``: toggle full screen. (Command-Control-Space on Mac OS X) The IPython pager ================= diff --git a/IPython/frontend/qt/console/qtconsoleapp.py b/IPython/frontend/qt/console/qtconsoleapp.py index 156d3d3..1f490c7 100644 --- a/IPython/frontend/qt/console/qtconsoleapp.py +++ b/IPython/frontend/qt/console/qtconsoleapp.py @@ -98,7 +98,7 @@ class MainWindow(QtGui.QMainWindow): self._frontend.exit_requested.connect(self.close) self._confirm_exit = confirm_exit self.setCentralWidget(frontend) - + #--------------------------------------------------------------------------- # QWidget interface #--------------------------------------------------------------------------- @@ -461,6 +461,19 @@ class IPythonQtConsoleApp(BaseIPythonApplication): self.init_kernel_manager() self.init_qt_elements() self.init_colors() + self.init_window_shortcut() + + def init_window_shortcut(self): + fullScreenAction = QtGui.QAction('Toggle Full Screen', self.window) + fullScreenAction.setShortcut('Ctrl+Meta+Space') + fullScreenAction.triggered.connect(self.toggleFullScreen) + self.window.addAction(fullScreenAction) + + def toggleFullScreen(self): + if not self.window.isFullScreen(): + self.window.showFullScreen() + else: + self.window.showNormal() def start(self):