1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Linux/FreeBSD/macOS: Column widths correct initially and on update (#1552)

Column width was updated before SlotListCtrl had the slots added,
which caused the column width to be incorrect before the first time
OnTimer ran to update it. Changing the order ensures the column width
is correct on program launch. Also ensure that we do not autosize
column to fit empty content.
This commit is contained in:
Jertzukka
2025-06-09 04:27:25 +03:00
committed by GitHub
parent 4e112df0d2
commit 5d1c48d5ba
2 changed files with 8 additions and 3 deletions

View File

@@ -1687,7 +1687,6 @@ namespace VeraCrypt
}
VolumeInfoList protectionTriggeredVolumes;
SlotListCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE);
// Update list
long prevItemIndex = -1;
@@ -1773,8 +1772,10 @@ namespace VeraCrypt
}
}
if (listChanged)
if (listChanged) {
SlotListCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE);
OnListChanged();
}
foreach (shared_ptr <VolumeInfo> volume, protectionTriggeredVolumes)
OnHiddenVolumeProtectionTriggered (volume);

View File

@@ -2072,8 +2072,12 @@ namespace VeraCrypt
{
item.SetText (field);
listCtrl->SetItem (item);
if (item.GetColumn() == 3 || item.GetColumn() == 4)
if ((item.GetColumn() == 3 || item.GetColumn() == 4) && !item.GetText().IsEmpty())
listCtrl->SetColumnWidth(item.GetColumn(), wxLIST_AUTOSIZE);
// SlotListCtrl headers do not automatically move with column widths changing on macOS
#ifdef TC_MACOSX
listCtrl->Update();
#endif
changed = true;
}
}