Commits

Yuya Nishihara committed af3855e

ref

  • Participants
  • Parent commits 97f2ad7

Comments (0)

Files changed (1)

File repom-graphctxindex.diff

 # HG changeset patch
 # Date 1395561665 -32400
-# Parent 5d93e52eea439da19f26760ef95a711946609a78
+# Parent a259127007641e7c11d00a04954f7ef7f33cba54
 
 diff --git a/tortoisehg/hgqt/repomodel.py b/tortoisehg/hgqt/repomodel.py
 --- a/tortoisehg/hgqt/repomodel.py
 +++ b/tortoisehg/hgqt/repomodel.py
-@@ -371,7 +371,7 @@ class HgRepoListModel(QAbstractTableMode
-     def col2x(self, col):
-         return 2 * self.dotradius * col + self.dotradius/2 + 8
+@@ -395,7 +395,7 @@ class HgRepoListModel(QAbstractTableMode
+         maxradius = self.rowheight / 2
+         return maxradius * (col + 1)
  
 -    def graphctx(self, ctx, gnode):
 +    def graphctx(self, index, ctx, gnode):
-         w = self.col2x(gnode.cols) + 10
+         w = self.col2x(gnode.cols)
          h = self.rowheight
  
-@@ -379,12 +379,12 @@ class HgRepoListModel(QAbstractTableMode
+@@ -403,12 +403,12 @@ class HgRepoListModel(QAbstractTableMode
          pix.fill(QColor(0,0,0,0))
          painter = QPainter(pix)
          try:
--            self._drawgraphctx(painter, pix, ctx, gnode)
-+            self._drawgraphctx(painter, pix, index, ctx, gnode)
+-            self._drawgraphctx(painter, ctx, gnode)
++            self._drawgraphctx(painter, index, ctx, gnode)
          finally:
              painter.end()
          return QVariant(pix)
  
--    def _drawgraphctx(self, painter, pix, ctx, gnode):
-+    def _drawgraphctx(self, painter, pix, index, ctx, gnode):
+-    def _drawgraphctx(self, painter, ctx, gnode):
++    def _drawgraphctx(self, painter, index, ctx, gnode):
          revset = self.revset
-         h = pix.height()
+         h = self.rowheight
          dot_y = h / 2
-@@ -548,13 +548,15 @@ class HgRepoListModel(QAbstractTableMode
-             idx = index.column() + offset
+@@ -578,13 +578,15 @@ class HgRepoListModel(QAbstractTableMode
+         idx = self._cacheindexmap[role, index.column()]
          if data[idx] is None:
              try:
 -                result = self.rawdata(row, index.column(), role)
          gnode = self.graph[row]
          ctx = self.repo.changectx(gnode.rev)
  
-@@ -575,7 +577,7 @@ class HgRepoListModel(QAbstractTableMode
-             if column == BranchColumn:
-                 return QVariant(QColor(self.namedbranch_color(ctx.branch())))
+@@ -614,7 +616,7 @@ class HgRepoListModel(QAbstractTableMode
+                 font.setBold(True)
+                 return font
          elif role == GraphRole:
 -            return self.graphctx(ctx, gnode)
 +            return self.graphctx(index, ctx, gnode)