Commits

Yuya Nishihara committed 34cab22

ref

  • Participants
  • Parent commits 906df3b

Comments (0)

Files changed (1)

File graphdele-roleref.diff

 # HG changeset patch
 # Date 1395570625 -32400
-# Parent 3f81152f2c0a13439dd11e277d606b9c13871281
+# Parent 9d9fb50c640c54a5b86b55e4c1d323b99cb4f5ae
 
-diff --git a/tortoisehg/hgqt/graphdelegate.py b/tortoisehg/hgqt/graphdelegate.py
---- a/tortoisehg/hgqt/graphdelegate.py
-+++ b/tortoisehg/hgqt/graphdelegate.py
-@@ -17,8 +17,6 @@ from mercurial import util
- from tortoisehg.hgqt import graph, repomodel
+diff --git a/tortoisehg/hgqt/repoview.py b/tortoisehg/hgqt/repoview.py
+--- a/tortoisehg/hgqt/repoview.py
++++ b/tortoisehg/hgqt/repoview.py
+@@ -413,10 +413,6 @@ class HgRepoViewStyle(QStyle):
+         return self._style.standardIconImplementation(*args)
  
- # TODO
+ 
+-# TODO: delete temporary aliases
 -GraphNodeRole = repomodel.GraphNodeRole
--RawContextRole = repomodel.RawContextRole
- get_color = repomodel.get_color
+-get_color = repomodel.get_color
+-
+ def get_style(line_type, active):
+     if line_type == graph.LINE_TYPE_GRAFT:
+         return Qt.DashLine
+@@ -433,7 +429,7 @@ def _edge_color(edge, active):
+     if not active or edge.linktype == graph.LINE_TYPE_FAMILY:
+         return "gray"
+     else:
+-        return get_color(edge.color)
++        return repomodel.get_color(edge.color)
  
- def get_style(line_type, active):
-@@ -55,8 +53,8 @@ class GraphDelegate(QStyledItemDelegate)
-         return 2 * self.dotradius * col + self.dotradius/2 + 8
+ 
+ class GraphDelegate(QStyledItemDelegate):
+@@ -459,7 +455,7 @@ class GraphDelegate(QStyledItemDelegate)
+         return maxradius * (col + 1)
  
      def graphctx(self, index):
 -        gnode = index.data(GraphNodeRole).toPyObject()
--        ctx = index.data(RawContextRole).toPyObject()
 +        gnode = index.data(repomodel.GraphNodeRole).toPyObject()
-+        ctx = index.data(repomodel.RawContextRole).toPyObject()
-         if gnode is None or ctx is None:
-             return
-         w = self.col2x(gnode.cols) + 10
+         w = self.col2x(gnode.cols)
+         h = self.rowheight
+