Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

csinfo: use QLabel to display changeset info

QLabel supports rich text (HTML subset).

Changeset 65fa71e7341f

Parent 973b6c131722

by Yuki KODAMA

Changes to one file · Browse files at 65fa71e7341f Showing diff from parent 973b6c131722 Diff from another changeset...

 
10
11
12
13
 
14
15
16
 
399
400
401
402
403
 
 
404
405
406
 
585
586
587
588
 
589
590
591
592
 
593
594
595
596
597
598
599
600
601
602
603
604
605
 
638
639
640
641
 
642
643
 
10
11
12
 
13
14
15
16
 
399
400
401
 
 
402
403
404
405
406
 
585
586
587
 
588
589
590
591
 
592
593
 
 
 
 
 
 
 
 
 
594
595
596
 
629
630
631
 
632
633
634
@@ -10,7 +10,7 @@
 import binascii    from PyQt4.QtCore import Qt -from PyQt4.QtGui import QTextEdit, QWidget, QFrame, QPalette, QTextBrowser +from PyQt4.QtGui import QWidget, QFrame, QPalette, QLabel    from mercurial import patch, util, error  from mercurial.node import hex @@ -399,8 +399,8 @@
  markups = (markups,)   labels = []   for text in markups: - label = QTextEdit() - label.setHtml(text) + label = QLabel() + label.setText(text)   labels.append(label)   return labels   markups = self.get_markup(item, *args) @@ -585,21 +585,12 @@
   LABEL_PAT = re.compile(r'(?:(?<=%%)|(?<!%)%\()(\w+)(?:\)s)')   -class SummaryLabel(SummaryBase, QTextBrowser): +class SummaryLabel(SummaryBase, QLabel):     def __init__(self, target, style, custom, repo, info):   SummaryBase.__init__(self, target, custom, repo, info) - QTextBrowser.__init__(self) + QLabel.__init__(self)   - self.setFrameStyle(QFrame.NoFrame | QFrame.Plain) - palette = self.palette() - color = palette.color(QPalette.Disabled, QPalette.Window) - css = 'QTextBrowser { background-color: rgb(%s, %s, %s); }' % \ - (color.red(), color.green(), color.blue()) - self.setStyleSheet(css) - self.setFixedHeight(32) - self.document().setDefaultStyleSheet('* { white-space: pre }') - self.document().setDocumentMargin(0.0)   self.csstyle = style     def update(self, target=None, style=None, custom=None, repo=None): @@ -638,6 +629,6 @@
  continue   # insert data & append to label   info += snip % data - self.setHtml(info) + self.setText(info)     return True