VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePimWizardPage.cpp
diff options
context:
space:
mode:
authorJertzukka <Jertzukka@gmail.com>2023-12-11 10:06:33 +0200
committerGitHub <noreply@github.com>2023-12-11 09:06:33 +0100
commitff93a6021fb744466661b666123dda96ecef5aba (patch)
treef04c99d99f24677a553fbec639c843ed585965b9 /src/Main/Forms/VolumePimWizardPage.cpp
parent1a21ea8d738424fe0f8c1bd3c1b2dd5636962944 (diff)
downloadVeraCrypt-ff93a6021fb744466661b666123dda96ecef5aba.tar.gz
VeraCrypt-ff93a6021fb744466661b666123dda96ecef5aba.zip
macOS: Fix near zero width PIM input box and simplify wxTextValidator logic (#1274)
* macOS: Fix issue where PIM box has no width in Wizard VolumePimTextCtrl has a problem with width on macOS which we can fix by adjusting the proportions of the elements inside the PimSizer, which seems like a better solution than using a forced minimum size in pixels. Adjacent, simplifies the validator logic for digits in PIM field. Fixes #1219
Diffstat (limited to 'src/Main/Forms/VolumePimWizardPage.cpp')
-rw-r--r--src/Main/Forms/VolumePimWizardPage.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Main/Forms/VolumePimWizardPage.cpp b/src/Main/Forms/VolumePimWizardPage.cpp
index c4f7014b..6500affb 100644
--- a/src/Main/Forms/VolumePimWizardPage.cpp
+++ b/src/Main/Forms/VolumePimWizardPage.cpp
@@ -23,6 +23,7 @@ namespace VeraCrypt
VolumePimWizardPage::VolumePimWizardPage (wxPanel* parent)
: VolumePimWizardPageBase (parent)
{
+ VolumePimTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumePimTextCtrl) * 15, -1));
SetPimValidator ();
}
@@ -91,9 +92,7 @@ namespace VeraCrypt
void VolumePimWizardPage::SetPimValidator ()
{
- wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
- const wxChar *valArr[] = { L"0", L"1", L"2", L"3", L"4", L"5", L"6", L"7", L"8", L"9" };
- validator.SetIncludes (wxArrayString (array_capacity (valArr), (const wxChar **) &valArr));
+ wxTextValidator validator (wxFILTER_DIGITS);
VolumePimTextCtrl->SetValidator (validator);
}