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 QTextBrowser instead of QTextEdit

Changeset d90c220505b9

Parent b3a9a1261eee

by Yuki KODAMA

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

 
10
11
12
13
 
14
15
16
 
585
586
587
588
 
589
590
591
592
 
593
594
595
596
597
598
599
 
 
 
 
600
601
602
 
10
11
12
 
13
14
15
16
 
585
586
587
 
588
589
590
591
 
592
593
 
594
595
596
 
 
597
598
599
600
601
602
603
@@ -10,7 +10,7 @@
 import binascii    from PyQt4.QtCore import Qt -from PyQt4.QtGui import QTextEdit, QWidget, QFrame, QPalette, QColor, QSizePolicy +from PyQt4.QtGui import QTextEdit, QWidget, QFrame, QPalette, QTextBrowser    from mercurial import patch, util, error  from mercurial.node import hex @@ -585,18 +585,19 @@
   LABEL_PAT = re.compile(r'(?:(?<=%%)|(?<!%)%\()(\w+)(?:\)s)')   -class SummaryLabel(SummaryBase, QTextEdit): +class SummaryLabel(SummaryBase, QTextBrowser):     def __init__(self, target, style, custom, repo, info):   SummaryBase.__init__(self, target, custom, repo, info) - QTextEdit.__init__(self) + QTextBrowser.__init__(self)   - self.setReadOnly(True)   self.setFrameStyle(QFrame.NoFrame | QFrame.Plain)   palette = self.palette()   color = palette.color(QPalette.Disabled, QPalette.Window) - self.setStyleSheet('QTextEdit { background-color: rgb(%s, %s, %s); }' % (color.red(), color.green(), color.blue())) - self.setFixedHeight(34) + 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