diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index 987f14f..00a0c7b 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -155,6 +155,14 @@ class ConsoleWidget(LoggingConfigurable, QtGui.QWidget): with the size of the font. """) + width = Integer(81, config=True, + help="""The width of the console at start time in number of caracters + """) + + height = Integer(25, config=True, + help="""The height of the console at start time in number of caracters + """) + # Whether to override ShortcutEvents for the keybindings defined by this # widget (Ctrl+n, Ctrl+a, etc). Enable this if you want this widget to take # priority (when it has focus) over, e.g., window-level menu shortcuts. @@ -469,12 +477,12 @@ class ConsoleWidget(LoggingConfigurable, QtGui.QWidget): # a fudge factor of one character here. # Note 2: QFontMetrics.maxWidth is not used here or anywhere else due # to a Qt bug on certain Mac OS systems where it returns 0. - width = font_metrics.width(' ') * 81 + margin + width = font_metrics.width(' ') * self.width + margin width += style.pixelMetric(QtGui.QStyle.PM_ScrollBarExtent) if self.paging == 'hsplit': width = width * 2 + splitwidth - height = font_metrics.height() * 25 + margin + height = font_metrics.height() * self.height + margin if self.paging == 'vsplit': height = height * 2 + splitwidth