Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable annotate: only create a single QsciStyle instance, they are numbered

There are a limited number of QsciStyle() instances you can allocate before
allocation fails and starts causing odd errors. Closes #125

Changeset c929aaf1e647

Parent ef3e37757b80

by Steve Borho

Changes to one file · Browse files at c929aaf1e647 Showing diff from parent ef3e37757b80 Diff from another changeset...

 
235
236
237
238
 
 
 
 
 
 
 
 
 
 
239
240
 
241
242
243
 
266
267
268
 
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
 
235
236
237
 
238
239
240
241
242
243
244
245
246
247
248
 
249
250
251
252
 
275
276
277
278
279
280
281
282
283
 
 
 
 
 
 
 
 
 
 
284
285
286
@@ -235,9 +235,18 @@
    def _updaterevmargin(self):   """Update the content of margin area showing revisions""" - style = self._margin_style() + s = self._margin_style + # Workaround to set style of the current sci widget. + # QsciStyle sends style data only to the first sci widget. + # See qscintilla2/Qt4/qscistyle.cpp + self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, + s.style(), s.paper()) + self.SendScintilla(QsciScintilla.SCI_STYLESETFONT, + s.style(), s.font().family().toAscii().data()) + self.SendScintilla(QsciScintilla.SCI_STYLESETSIZE, + s.style(), s.font().pointSize())   for i, (fctx, _origline) in enumerate(self._links): - self.setMarginText(i, str(fctx.rev()), style) + self.setMarginText(i, str(fctx.rev()), s)     def _updatemarkers(self):   """Update markers which colorizes each line""" @@ -266,21 +275,12 @@
  for fctx in fctxs:   self._revmarkers[fctx.rev()] = i   + @util.propertycache   def _margin_style(self):   """Style for margin area"""   s = QsciStyle()   s.setPaper(QApplication.palette().color(QPalette.Window))   s.setFont(self.font()) - - # Workaround to set style of the current sci widget. - # QsciStyle sends style data only to the first sci widget. - # See qscintilla2/Qt4/qscistyle.cpp - self.SendScintilla(QsciScintilla.SCI_STYLESETBACK, - s.style(), s.paper()) - self.SendScintilla(QsciScintilla.SCI_STYLESETFONT, - s.style(), s.font().family().toAscii().data()) - self.SendScintilla(QsciScintilla.SCI_STYLESETSIZE, - s.style(), s.font().pointSize())   return s     @pyqtSlot()