Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1.2 and tip

stable messageentry: allow resizing commit message box down to one line (fixes #44)

The commit message window will now hide its horizontal scroll bar if it is too
small for the scroll bar to appear without obstructing the text.

Changeset 7d09a3dc0ba4

Parent 68df62c90b8a

by David Golub

Changes to 2 files · Browse files at 7d09a3dc0ba4 Showing diff from parent 68df62c90b8a Diff from another changeset...

 
31
32
33
34
 
 
 
35
36
37
 
48
49
50
 
51
52
53
 
143
144
145
 
 
 
 
 
 
 
 
 
 
31
32
33
 
34
35
36
37
38
39
 
50
51
52
53
54
55
56
 
146
147
148
149
150
151
152
153
154
155
156
157
@@ -31,7 +31,9 @@
  self.setAutoCompletionSource(QsciScintilla.AcsAPIs)   self.setAutoCompletionFillupsEnabled(True)   self.setLexer(QsciLexerMakefile(self)) - self.lexer().setFont(qtlib.getfont('fontcomment').font()) + font = qtlib.getfont('fontcomment').font() + self.fontHeight = QFontMetrics(font).height() + self.lexer().setFont(font)   self.lexer().setColor(QColor(Qt.red), QsciLexerMakefile.Error)   self.setMatchedBraceBackgroundColor(Qt.yellow)   self.setIndentationsUseTabs(False) @@ -48,6 +50,7 @@
  self.setContextMenuPolicy(Qt.CustomContextMenu)   self.customContextMenuRequested.connect(self.menuRequested)   +   def menuRequested(self, point):   line = self.lineAt(point)   point = self.viewport().mapToGlobal(point) @@ -143,3 +146,12 @@
  super(MessageEntry, self).keyPressEvent(newev)   else:   super(MessageEntry, self).keyPressEvent(event) + + def resizeEvent(self, event): + super(MessageEntry, self).resizeEvent(event) + self.showHScrollBar(self.frameGeometry().height() > self.fontHeight * 3) + + def minimumSizeHint(self): + size = super(MessageEntry, self).minimumSizeHint() + size.setHeight(self.fontHeight * 3 / 2) + return size
 
305
306
307
 
 
 
308
309
310
 
305
306
307
308
309
310
311
312
313
@@ -305,6 +305,9 @@
  self.SendScintilla(self.SCI_INDICSETALPHA, id, 100)   return id   + def showHScrollBar(self, show=True): + self.SendScintilla(self.SCI_SETHSCROLLBAR, show) +  class SearchToolBar(QToolBar):   conditionChanged = pyqtSignal(unicode, bool, bool)   """Emitted (pattern, icase, wrap) when search condition changed"""