[PATCH] repoview: deleted automatic resizing of the Description column (fixes #5559)

27 views
Skip to first unread message

Denis Matsiusheuski

unread,
Jul 16, 2024, 3:26:19 PM (11 days ago) Jul 16
to thg...@googlegroups.com
# 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)


Denis Matsiusheuski

unread,
Jul 16, 2024, 3:26:30 PM (11 days ago) Jul 16
to thg...@googlegroups.com, dzianis.ma...@vpidevcenter.com

Yuya Nishihara

unread,
Jul 17, 2024, 7:10:44 AM (10 days ago) Jul 17
to Denis Matsiusheuski, thg...@googlegroups.com
On Tue, 16 Jul 2024 19:54:17 +0300, Denis Matsiusheuski wrote:
> # 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)

Queued for stable, thanks.

I guess the original code would work pretty well when it was written, but it
got rotten as Qt versions upgraded. Suppose we don't have developer resources
to fix the problem, I agree it's better to remove the hack.
Reply all
Reply to author
Forward
0 new messages