# HG changeset patch
# User Matt Harbison <
matt_h...@yahoo.com>
# Date 1427491092 14400
# Fri Mar 27 17:18:12 2015 -0400
# Branch stable
# Node ID 1f7207198b558aa46910d2adcf6703d50a92a39a
# Parent 8d7476aab155938e1c54953b321b5b3fca026add
repowidget: stop the description column from shrinking on restart (refs #3882)
Previously, the description column would shrink by the width of the vertical
scrollbar, and the space was added to the last column. The width of the last
column was saved on exit, reloaded with that new size on the next start, and
then given another scrollbar width. After several restarts, a noticeable amount
of space was added to the last column, at the expense of the description.
This defers the column resizing until after the model is loaded, and the view is
cut down to make room for the vertical scrollbar, if necessary. It looks like
this was the same deferal used prior to 4358a32970a8, which landed in 3.3. On
some systems, there is a small lag where the columns are small before they snap
to their stored size.
diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
--- a/tortoisehg/hgqt/repowidget.py
+++ b/tortoisehg/hgqt/repowidget.py
@@ -174,7 +174,7 @@
def _initView(self):
self._updateRepoViewForModel()
# restore column widths when model is initially loaded
- self.repoview.resizeColumns()
+ QTimer.singleShot(0, self.repoview.resizeColumns)
# select the widget chosen by the user
name = self.repo.ui.config('tortoisehg', 'defaultwidget')