Source

thg-qt-mq / stretch.diff

# HG changeset patch
# Parent 864b124562f3d2dc93325ec3403734e140a411b7

diff --git a/tortoisehg/hgqt/repoview.py b/tortoisehg/hgqt/repoview.py
--- a/tortoisehg/hgqt/repoview.py
+++ b/tortoisehg/hgqt/repoview.py
@@ -97,16 +97,20 @@ class HgRepoView(QTableView):
                 self.setItemDelegateForColumn(c, self.htmlDelegate)
             else:
                 self.setItemDelegateForColumn(c, self.standardDelegate)
+            if model._columns[c] in model._stretchs:
+                self.horizontalHeader().setResizeMode(c, QHeaderView.Stretch)
+            else:
+                self.horizontalHeader().setResizeMode(c, QHeaderView.Interactive)
 
     def resizeColumns(self, *args):
         # resize columns the smart way: the column holding Description
         # is resized according to the total widget size.
         if not self.model():
             return
-        hh = self.horizontalHeader()
-        hh.setStretchLastSection(False)
+        #hh = self.horizontalHeader()
+        #hh.setStretchLastSection(False)
         self._resizeColumns()
-        hh.setStretchLastSection(True)
+        #hh.setStretchLastSection(True)
 
     def _resizeColumns(self):
         # _resizeColumns misbehaves if called with last section streched