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

csinfo: make QLabel an inner widget

Changeset fb1a8a6a4b03

Parent fae3f069327d

by Yuki KODAMA

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

 
10
11
12
13
 
14
15
16
 
510
511
512
513
 
514
515
516
517
 
518
519
520
 
 
 
 
 
521
522
523
 
525
526
527
 
 
 
 
528
529
530
531
 
532
533
534
 
563
564
565
566
 
567
568
569
 
10
11
12
 
13
14
15
16
 
510
511
512
 
513
514
515
516
 
517
518
519
520
521
522
523
524
525
526
527
528
 
530
531
532
533
534
535
536
537
538
539
 
540
541
542
543
 
572
573
574
 
575
576
577
578
@@ -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