Showing with 8,705 additions and 1 deletion.
  1. +10 −1 python/console/console_sci.py
  2. +8,695 −0 python/qsci_apis/PyQGIS-2.0.api
  3. BIN python/qsci_apis/pyqgis.pap
11 changes: 10 additions & 1 deletion python/console/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def __init__(self, parent=None):

# not too small
#self.setMinimumSize(500, 300)
self.setMinimumHeight(20)

self.setWrapMode(QsciScintilla.WrapCharacter)
self.SendScintilla(QsciScintilla.SCI_EMPTYUNDOBUFFER)
Expand All @@ -113,6 +112,13 @@ def __init__(self, parent=None):
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 refreshSettingsShell(self):
# Set Python lexer
self.setLexers()
Expand All @@ -133,6 +139,9 @@ def refreshSettingsShell(self):
cursorColor = self.settings.value("pythonConsole/cursorColor", QColor(Qt.black))
self.setCaretForegroundColor(cursorColor)

# Sets minimum height for input area based of font metric
self._setMinimumHeight()

def showHistory(self):
if not self.historyDlg.isVisible():
self.historyDlg.show()
Expand Down
Loading