# HG changeset patch
# User Denis Matsiusheuski <
dzianis.ma...@vpidevcenter.com>
# Date 1721133394 -10800
# Tue Jul 16 15:36:34 2024 +0300
# Branch stable
# Node ID 58ab3c749493c03fae98004ea0b3590249561eef
# Parent 4f74c22b4c68d3c0a7eeced107052d3da4cd2f6a
repoview: deleted automatic resizing of the Description column (fixes #5559)
The automatic resizing of the Description column in the log table is probably
useful in some cases. However, sometimes it leads to nonintuitive behavior
connected to resizing the table. Several bugs connected to this problem are
opened. After the fix, automatic resizing of the column width is not applied.
diff -r 4f74c22b4c68 -r 58ab3c749493 tortoisehg/hgqt/repoview.py
--- a/tortoisehg/hgqt/repoview.py Tue Jul 16 14:25:01 2024 +0200
+++ b/tortoisehg/hgqt/repoview.py Tue Jul 16 15:36:34 2024 +0300
@@ -86,7 +86,6 @@
QTableView.__init__(self, parent)
self._repoagent = repoagent
self.current_rev = -1
- self.resized = False
self.cfgname = cfgname
self.colselect = colselect
self.setShowGrid(False)
@@ -285,7 +284,6 @@
hh.setStretchLastSection(False)
self._resizeColumns(col_widths)
hh.setStretchLastSection(True)
- self.resized = True
def _resizeColumns(self, col_widths):
# _resizeColumns misbehaves if called with last section streched
@@ -497,27 +495,6 @@
self._adjustRowHeight()
super(HgRepoView, self).showEvent(event)
- def resizeEvent(self, e):
- # re-size columns the smart way: the column holding Description
- # is re-sized according to the total widget size.
- if self.resized and e.oldSize().width() != e.size().width():
- model = self.model()
- assert model is not None
- total_width = stretch_col = 0
-
- for c in range(model.columnCount()):
- if c == repomodel.DescColumn:
- #save the description column
- stretch_col = c
- else:
- #total the other widths
- total_width += self.columnWidth(c)
-
- width = max(self.viewport().width() - total_width, 100)
- self.setColumnWidth(stretch_col, width)
-
- super(HgRepoView, self).resizeEvent(e)
-
def enablefilterpalette(self, enable):
self._paletteswitcher.enablefilterpalette(enable)