mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
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
This commit is contained in:
@@ -45,10 +45,10 @@ namespace VeraCrypt
|
|||||||
BufferSizeChoice->Select (1);
|
BufferSizeChoice->Select (1);
|
||||||
|
|
||||||
UpdateBenchmarkList ();
|
UpdateBenchmarkList ();
|
||||||
|
|
||||||
wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
|
VolumePimText->SetMinSize (wxSize (Gui->GetCharWidth (VolumePimText) * 15, -1));
|
||||||
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);
|
||||||
VolumePimText->SetValidator (validator);
|
VolumePimText->SetValidator (validator);
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
|
|||||||
@@ -172,9 +172,7 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
void VolumePasswordPanel::SetPimValidator ()
|
void VolumePasswordPanel::SetPimValidator ()
|
||||||
{
|
{
|
||||||
wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
|
wxTextValidator validator (wxFILTER_DIGITS);
|
||||||
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));
|
|
||||||
VolumePimTextCtrl->SetValidator (validator);
|
VolumePimTextCtrl->SetValidator (validator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ namespace VeraCrypt
|
|||||||
VolumePimWizardPage::VolumePimWizardPage (wxPanel* parent)
|
VolumePimWizardPage::VolumePimWizardPage (wxPanel* parent)
|
||||||
: VolumePimWizardPageBase (parent)
|
: VolumePimWizardPageBase (parent)
|
||||||
{
|
{
|
||||||
|
VolumePimTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumePimTextCtrl) * 15, -1));
|
||||||
SetPimValidator ();
|
SetPimValidator ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,9 +92,7 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
void VolumePimWizardPage::SetPimValidator ()
|
void VolumePimWizardPage::SetPimValidator ()
|
||||||
{
|
{
|
||||||
wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
|
wxTextValidator validator (wxFILTER_DIGITS);
|
||||||
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));
|
|
||||||
VolumePimTextCtrl->SetValidator (validator);
|
VolumePimTextCtrl->SetValidator (validator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,9 +73,7 @@ namespace VeraCrypt
|
|||||||
|
|
||||||
VolumeSizeTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumeSizeTextCtrl) * 20, -1));
|
VolumeSizeTextCtrl->SetMinSize (wxSize (Gui->GetCharWidth (VolumeSizeTextCtrl) * 20, -1));
|
||||||
|
|
||||||
wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); // wxFILTER_NUMERIC does not exclude - . , etc.
|
wxTextValidator validator (wxFILTER_DIGITS);
|
||||||
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));
|
|
||||||
VolumeSizeTextCtrl->SetValidator (validator);
|
VolumeSizeTextCtrl->SetValidator (validator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user