Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide means for starting the Qt console maximized and with the menu bar hidden #3431

Merged
merged 1 commit into from
Jun 15, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need these aliases, every configurable is always available, even if they aren't added to the shortlist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a duplicate of your previous comment?
I removed the aliases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, yes. I thought I forgot to make that comment. Please ignore me :)

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