From 2cdfbd2703e52e940771c128d79caa699b2c6650 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 26 Oct 2014 13:44:10 +0100 Subject: Linux/MacOSX: Remove static size values from GUI in order to let wxWidgets calculate the best size (the "Fit" method ensure this). Fix truncation of text is some dialogs. --- src/Main/Forms/Forms.cpp | 11 ++++++++++- src/Main/Forms/Forms.h | 6 +++--- src/Main/Forms/TrueCrypt.fbp | 14 +++++++------- 3 files changed, 20 insertions(+), 11 deletions(-) (limited to 'src/Main/Forms') diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp index 138ea60a..c927bf50 100644 --- a/src/Main/Forms/Forms.cpp +++ b/src/Main/Forms/Forms.cpp @@ -392,6 +392,7 @@ MainFrameBase::MainFrameBase( wxWindow* parent, wxWindowID id, const wxString& t this->SetSizer( bSizer1 ); this->Layout(); + bSizer1->Fit( this ); this->Centre( wxBOTH ); @@ -1743,7 +1744,9 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c DismountOnInactivityCheckBox = new wxCheckBox( SecurityPage, wxID_ANY, _("Auto-dismount volume after no data has been read/written to it for"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer34->Add( DismountOnInactivityCheckBox, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - DismountOnInactivitySpinCtrl = new wxSpinCtrl( SecurityPage, wxID_ANY, wxT("1"), wxDefaultPosition, wxSize( 60,-1 ), wxSP_ARROW_KEYS, 1, 9999, 1 ); + DismountOnInactivitySpinCtrl = new wxSpinCtrl( SecurityPage, wxID_ANY, wxT("1"), wxDefaultPosition, wxSize( -1,-1 ), wxSP_ARROW_KEYS, 1, 9999, 1 ); + DismountOnInactivitySpinCtrl->SetMinSize( wxSize( 60,-1 ) ); + bSizer34->Add( DismountOnInactivitySpinCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); wxStaticText* m_staticText5; @@ -2542,6 +2545,8 @@ InfoWizardPageBase::~InfoWizardPageBase() KeyfilesPanelBase::KeyfilesPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { + this->SetMinSize( wxSize( 500,300 ) ); + wxBoxSizer* bSizer19; bSizer19 = new wxBoxSizer( wxVERTICAL ); @@ -2584,6 +2589,7 @@ KeyfilesPanelBase::KeyfilesPanelBase( wxWindow* parent, wxWindowID id, const wxP this->SetSizer( bSizer19 ); this->Layout(); + bSizer19->Fit( this ); // Connect Events KeyfilesListCtrl->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( KeyfilesPanelBase::OnListItemDeselected ), NULL, this ); @@ -2657,6 +2663,8 @@ ProgressWizardPageBase::~ProgressWizardPageBase() SelectDirectoryWizardPageBase::SelectDirectoryWizardPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : WizardPage( parent, id, pos, size, style ) { + this->SetMinSize( wxSize( 200,65 ) ); + wxBoxSizer* bSizer68; bSizer68 = new wxBoxSizer( wxVERTICAL ); @@ -2686,6 +2694,7 @@ SelectDirectoryWizardPageBase::SelectDirectoryWizardPageBase( wxWindow* parent, this->SetSizer( bSizer68 ); this->Layout(); + bSizer68->Fit( this ); // Connect Events DirectoryTextCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SelectDirectoryWizardPageBase::OnDirectoryTextChanged ), NULL, this ); diff --git a/src/Main/Forms/Forms.h b/src/Main/Forms/Forms.h index f20a7628..7c485ee9 100644 --- a/src/Main/Forms/Forms.h +++ b/src/Main/Forms/Forms.h @@ -147,7 +147,7 @@ namespace VeraCrypt public: - MainFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("VeraCrypt"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,496 ), long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL ); + MainFrameBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("VeraCrypt"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxTAB_TRAVERSAL ); ~MainFrameBase(); @@ -766,7 +766,7 @@ namespace VeraCrypt public: - KeyfilesPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL ); + KeyfilesPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); ~KeyfilesPanelBase(); }; @@ -814,7 +814,7 @@ namespace VeraCrypt public: - SelectDirectoryWizardPageBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 200,65 ), long style = wxTAB_TRAVERSAL ); + SelectDirectoryWizardPageBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); ~SelectDirectoryWizardPageBase(); }; diff --git a/src/Main/Forms/TrueCrypt.fbp b/src/Main/Forms/TrueCrypt.fbp index 9913c09f..e297157c 100644 --- a/src/Main/Forms/TrueCrypt.fbp +++ b/src/Main/Forms/TrueCrypt.fbp @@ -44,7 +44,7 @@ -1,496 MainFrameBase - -1,496 + -1,-1 wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxSYSTEM_MENU VeraCrypt @@ -12833,7 +12833,7 @@ 1 0 - + 60,-1 1 DismountOnInactivitySpinCtrl 1 @@ -12844,7 +12844,7 @@ Resizable 1 - 60,-1 + -1,-1 wxSP_ARROW_KEYS 0 @@ -19939,10 +19939,10 @@ 0 wxID_ANY - + 500,300 KeyfilesPanelBase - 500,300 + -1,-1 @@ -20915,10 +20915,10 @@ 0 wxID_ANY - + 200,65 SelectDirectoryWizardPageBase - 200,65 + -1,-1 WizardPage; WizardPage.h -- cgit v1.2.3