##// END OF EJS Templates
make qtconsole size at startup configurable
Matthias BUSSONNIER -
Show More
@@ -155,6 +155,14 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
155 with the size of the font.
155 with the size of the font.
156 """)
156 """)
157
157
158 width = Integer(81, config=True,
159 help="""The width of the console at start time in number of caracters
160 """)
161
162 height = Integer(25, config=True,
163 help="""The height of the console at start time in number of caracters
164 """)
165
158 # Whether to override ShortcutEvents for the keybindings defined by this
166 # Whether to override ShortcutEvents for the keybindings defined by this
159 # widget (Ctrl+n, Ctrl+a, etc). Enable this if you want this widget to take
167 # widget (Ctrl+n, Ctrl+a, etc). Enable this if you want this widget to take
160 # priority (when it has focus) over, e.g., window-level menu shortcuts.
168 # priority (when it has focus) over, e.g., window-level menu shortcuts.
@@ -469,12 +477,12 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
469 # a fudge factor of one character here.
477 # a fudge factor of one character here.
470 # Note 2: QFontMetrics.maxWidth is not used here or anywhere else due
478 # Note 2: QFontMetrics.maxWidth is not used here or anywhere else due
471 # to a Qt bug on certain Mac OS systems where it returns 0.
479 # to a Qt bug on certain Mac OS systems where it returns 0.
472 width = font_metrics.width(' ') * 81 + margin
480 width = font_metrics.width(' ') * self.width + margin
473 width += style.pixelMetric(QtGui.QStyle.PM_ScrollBarExtent)
481 width += style.pixelMetric(QtGui.QStyle.PM_ScrollBarExtent)
474 if self.paging == 'hsplit':
482 if self.paging == 'hsplit':
475 width = width * 2 + splitwidth
483 width = width * 2 + splitwidth
476
484
477 height = font_metrics.height() * 25 + margin
485 height = font_metrics.height() * self.height + margin
478 if self.paging == 'vsplit':
486 if self.paging == 'vsplit':
479 height = height * 2 + splitwidth
487 height = height * 2 + splitwidth
480
488
General Comments 0
You need to be logged in to leave comments. Login now