Skip to content

Commit

Permalink
TableResultTabWidget: Check all column widths to reduce wide ones.
Browse files Browse the repository at this point in the history
Previously it was only checking one column.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
  • Loading branch information
pebenito committed Dec 4, 2023
1 parent b1368c0 commit a393486
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions setoolsgui/widgets/tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,17 @@ def query_completed(self, count: int) -> None:
self.busy.setLabelText("Resizing the result table's columns; GUI may be unresponsive")
self.busy.repaint()
self.table_results.resizeColumnsToContents()
# If the permissions column width is too long, pull back
# to a reasonable size
header = self.table_results.horizontalHeader()
assert header, "No header set, this is an SETools bug" # type narrowing
if header.sectionSize(4) > 400:
header.resizeSection(4, 400)

# If the column widths are too long, pull back to a reasonable size
header = self.table_results.horizontalHeader()
assert header, "No header set, this is an SETools bug" # type narrowing
self.busy.setLabelText("Resizing very wide columns; GUI may be unresponsive")
for i in range(header.count()):
if header.sectionSize(i) > 400:
header.resizeSection(i, 400)

if self.busy.wasCanceled():
break

if not self.busy.wasCanceled():
self.busy.setLabelText("Resizing the result table's rows; GUI may be unresponsive")
Expand Down

0 comments on commit a393486

Please sign in to comment.