Commits

Anonymous committed 392125b

hggtk/datamine: revise ellipsize mode on treeviews

Comments (0)

Files changed (1)

hggtk/datamine.py

 
         results = gtk.ListStore(str, str, str, str)
         treeview.set_model(results)
-        for title, width, col in (('Rev', 10, self.COL_REVID),
-                ('File', 25, self.COL_PATH),
-                ('Matches', 80, self.COL_TEXT)):
+        for title, width, col, emode in (
+                ('Rev', 10, self.COL_REVID, pango.ELLIPSIZE_NONE),
+                ('File', 25, self.COL_PATH, pango.ELLIPSIZE_START),
+                ('Matches', 80, self.COL_TEXT, pango.ELLIPSIZE_END)):
             cell = gtk.CellRendererText()
             cell.set_property("width-chars", width)
-            cell.set_property("ellipsize", pango.ELLIPSIZE_START)
+            cell.set_property("ellipsize", emode)
             cell.set_property("family", "Monospace")
             column = gtk.TreeViewColumn(title)
             column.set_resizable(True)
         treeview.set_model(results)
 
         context_menu = self.ann_header_context_menu(treeview)
-        for title, width, col, visible in (
-                ('Rev', 10, self.COL_REVID, True),
-                ('File', 15, self.COL_PATH, False),
-                ('User', 15, self.COL_USER, False),
-                ('Matches', 80, self.COL_TEXT, True)):
+        for title, width, col, emode, visible in (
+                ('Rev', 10, self.COL_REVID, pango.ELLIPSIZE_NONE, True),
+                ('File', 15, self.COL_PATH, pango.ELLIPSIZE_START, False),
+                ('User', 15, self.COL_USER, pango.ELLIPSIZE_END, False),
+                ('Matches', 80, self.COL_TEXT, pango.ELLIPSIZE_END, True)):
             cell = gtk.CellRendererText()
             cell.set_property("width-chars", width)
-            cell.set_property("ellipsize", pango.ELLIPSIZE_START)
+            cell.set_property("ellipsize", emode)
             cell.set_property("family", "Monospace")
             column = gtk.TreeViewColumn(title)
             column.set_resizable(True)
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.