Changeset fb1a8a6a4b03…
Parent fae3f069327d…
by
Changes to one file · Browse files at fb1a8a6a4b03 Showing diff from parent fae3f069327d Diff from another changeset...
@@ -10,7 +10,7 @@ import binascii
from PyQt4.QtCore import Qt
-from PyQt4.QtGui import QWidget, QLabel
+from PyQt4.QtGui import QWidget, QLabel, QHBoxLayout
from mercurial import patch, util, error
from mercurial.node import hex
@@ -510,14 +510,19 @@ return False # cannot update
return True
-class SummaryPanel(SummaryBase, QLabel):
+class SummaryPanel(SummaryBase, QWidget):
def __init__(self, target, style, custom, repo, info):
SummaryBase.__init__(self, target, custom, repo, info)
- QLabel.__init__(self)
+ QWidget.__init__(self)
self.csstyle = style
+ hbox = QHBoxLayout()
+ hbox.setMargin(0)
+ self.setLayout(hbox)
+ self.revlabel = None
+
def update(self, target=None, style=None, custom=None, repo=None):
if not SummaryBase.update(self, target, custom, repo):
return False # cannot update
@@ -525,10 +530,14 @@ if style is not None:
self.csstyle = style
+ if self.revlabel is None:
+ self.revlabel = QLabel()
+ self.layout().addWidget(self.revlabel)
+
if 'selectable' in self.csstyle:
sel = self.csstyle['selectable']
val = sel and Qt.TextSelectableByMouse or Qt.TextBrowserInteraction
- self.setTextInteractionFlags(val)
+ self.revlabel.setTextInteractionFlags(val)
# if 'label' in self.csstyle:
# label = self.csstyle['label']
@@ -563,7 +572,7 @@ markups = (markups,)
buf += ', '.join(markups) + '</td></tr>'
buf += '</table>'
- self.setText(buf)
+ self.revlabel.setText(buf)
return True
|
Loading...