Created
October 8, 2013 21:05
-
-
Save slarosa/6891670 to your computer and use it in GitHub Desktop.
patch console_sci.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/python/console/console_sci.py | |
| +++ b/python/console/console_sci.py | |
| @@ -90,7 +90,6 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter): | |
| # not too small | |
| #self.setMinimumSize(500, 300) | |
| - self.setMinimumHeight(20) | |
| self.setWrapMode(QsciScintilla.WrapCharacter) | |
| self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER) | |
| @@ -112,6 +111,13 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter): | |
| self.newShortcutCAS.activated.connect(self.autoCompleteKeyBinding) | |
| self.newShortcutCSS.activated.connect(self.showHistory) | |
| + def _setMinimumHeight(self): | |
| + fnt = self.settings.value("pythonConsole/fontfamilytext", "Monospace") | |
| + fntSize = self.settings.value("pythonConsole/fontsize", 10, type=int) | |
| + fm = QFontMetrics(QFont(fnt, fntSize)) | |
| + | |
| + self.setMinimumHeight(fm.height() + 10) | |
| + | |
| def settingsShell(self): | |
| # Set Python lexer | |
| self.setLexers() | |
| @@ -129,6 +135,9 @@ class ShellScintilla(QsciScintilla, code.InteractiveInterpreter): | |
| else: | |
| self.setAutoCompletionSource(self.AcsNone) | |
| + # Sets minimum height for input area based of font metric | |
| + self._setMinimumHeight() | |
| + | |
| def showHistory(self): | |
| if not self.historyDlg.isVisible(): | |
| self.historyDlg.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment