mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 02:58: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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user