Skip to content

Commit

Permalink
Merge pull request ipython#3431 from dankilman/master
Browse files Browse the repository at this point in the history
Provide means for starting the Qt console maximized and with the menu bar hidden
  • Loading branch information
ellisonbg committed Jun 15, 2013
2 parents f9f48d0 + 4d312b6 commit 38e6f88
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion IPython/frontend/qt/console/qtconsoleapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ class IPythonQtConsoleApp(BaseIPythonApplication, IPythonConsoleApp):
stylesheet = Unicode('', config=True,
help="path to a custom CSS stylesheet")

hide_menubar = CBool(False, config=True,
help="Start the console window with the menu bar hidden.")

maximize = CBool(False, config=True,
help="Start the console window maximized.")

plain = CBool(False, config=True,
help="Use a plaintext widget instead of rich text (plain can't print/save).")

Expand Down Expand Up @@ -269,6 +275,10 @@ def init_qt_elements(self):
self.window.add_tab_with_frontend(self.widget)
self.window.init_menu_bar()

# Ignore on OSX, where there is always a menu bar
if sys.platform != 'darwin' and self.hide_menubar:
self.window.menuBar().setVisible(False)

self.window.setWindowTitle('IPython')

def init_colors(self, widget):
Expand Down Expand Up @@ -355,7 +365,10 @@ def initialize(self, argv=None):
def start(self):

# draw the window
self.window.show()
if self.maximize:
self.window.showMaximized()
else:
self.window.show()
self.window.raise_()

# Start the application main loop.
Expand Down

0 comments on commit 38e6f88

Please sign in to comment.