Source

thg-qt-mq / font.patch

# HG changeset patch
# User Martin Geisler <mg@aragost.com>
# Date 1337954040 -7200
# Branch stable
# Node ID 76b2a111ec6e37d009b9d8bad5dd8ff2971bf1b9
# Parent  bde3469d7bf5a1a3da6f52d543b18c7356465ba9
repomodel: use monospace font for Node and Converted columns

diff --git a/tortoisehg/hgqt/repomodel.py b/tortoisehg/hgqt/repomodel.py
--- a/tortoisehg/hgqt/repomodel.py
+++ b/tortoisehg/hgqt/repomodel.py
@@ -82,6 +82,8 @@
     _allcolnames = dict(COLUMNHEADERS)
 
     _columns = ('Graph', 'Rev', 'Branch', 'Description', 'Author', 'Age', 'Tags', 'Phase',)
+    _columnfonts = {'Node': QFont("Monospace"),
+                    'Converted': QFont("Monospace")}
     _stretchs = {'Description': 1, }
     _mqtags = ('qbase', 'qtip', 'qparent')
 
@@ -408,6 +410,10 @@
     def data(self, index, role):
         if not index.isValid():
             return nullvariant
+        # font is not cached in self._cache since it is equal for all rows
+        if role == Qt.FontRole:
+            column = self._columns[index.column()]
+            return self._columnfonts.get(column, nullvariant)
         if role not in self._roleoffsets:
             return nullvariant
         try:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.