@@ -91,7 +91,6 @@ def __init__(self, parent=None):
91
91
92
92
# not too small
93
93
#self.setMinimumSize(500, 300)
94
- self .setMinimumHeight (20 )
95
94
96
95
self .setWrapMode (QsciScintilla .WrapCharacter )
97
96
self .SendScintilla (QsciScintilla .SCI_EMPTYUNDOBUFFER )
@@ -113,6 +112,13 @@ def __init__(self, parent=None):
113
112
self .newShortcutCAS .activated .connect (self .autoCompleteKeyBinding )
114
113
self .newShortcutCSS .activated .connect (self .showHistory )
115
114
115
+ def _setMinimumHeight (self ):
116
+ fnt = self .settings .value ("pythonConsole/fontfamilytext" , "Monospace" )
117
+ fntSize = self .settings .value ("pythonConsole/fontsize" , 10 , type = int )
118
+ fm = QFontMetrics (QFont (fnt , fntSize ))
119
+
120
+ self .setMinimumHeight (fm .height () + 10 )
121
+
116
122
def refreshSettingsShell (self ):
117
123
# Set Python lexer
118
124
self .setLexers ()
@@ -133,6 +139,9 @@ def refreshSettingsShell(self):
133
139
cursorColor = self .settings .value ("pythonConsole/cursorColor" , QColor (Qt .black ))
134
140
self .setCaretForegroundColor (cursorColor )
135
141
142
+ # Sets minimum height for input area based of font metric
143
+ self ._setMinimumHeight ()
144
+
136
145
def showHistory (self ):
137
146
if not self .historyDlg .isVisible ():
138
147
self .historyDlg .show ()
0 commit comments