Make GUI DPI-aware

This commit is contained in:
2018-09-17 11:43:19 +02:00
parent c7f1a66a4a
commit 10297c7ab3
24 changed files with 236 additions and 228 deletions

View File

@@ -113,12 +113,12 @@ wxTTLSConfigWindow::wxTTLSConfigWindow(eap::config_provider &prov, eap::config_m
sb_content = new wxBoxSizer( wxVERTICAL );
if (m_prov.m_read_only)
sb_content->Add(new wxEAPProviderLockedPanel(m_prov, this), 0, wxALL|wxEXPAND, 5);
sb_content->Add(new wxEAPProviderLockedPanel(m_prov, this), 0, wxALL|wxEXPAND, FromDIP(5));
m_inner_title = new wxStaticText(this, wxID_ANY, _("Inner Authentication"), wxDefaultPosition, wxDefaultSize, 0);
m_inner_title->SetFont(wxFont(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString));
m_inner_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) );
sb_content->Add(m_inner_title, 0, wxALL|wxALIGN_RIGHT, 5);
sb_content->Add(m_inner_title, 0, wxALL|wxALIGN_RIGHT, FromDIP(5));
m_inner_type = new wxChoicebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT);
m_inner_type->SetToolTip( _("Select inner authentication method from the list") );
@@ -134,26 +134,26 @@ wxTTLSConfigWindow::wxTTLSConfigWindow(eap::config_provider &prov, eap::config_m
wxEapHostConfigPanel *panel_eaphost = new wxEapHostConfigPanel(m_prov, m_cfg_eaphost, m_inner_type);
m_inner_type->AddPage(panel_eaphost, _("Other EAP methods..."));
#endif
sb_content->Add(m_inner_type, 0, wxALL|wxEXPAND, 5);
sb_content->Add(m_inner_type, 0, wxALL|wxEXPAND, FromDIP(5));
sb_content->Add(20, 20, 1, wxALL|wxEXPAND, 5);
sb_content->Add(FromDIP(20), FromDIP(20), 1, wxALL|wxEXPAND, FromDIP(5));
m_outer_title = new wxStaticText(this, wxID_ANY, _("Outer Authentication"), wxDefaultPosition, wxDefaultSize, 0);
m_outer_title->SetFont(wxFont(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString));
m_outer_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) );
sb_content->Add(m_outer_title, 0, wxALL|wxALIGN_RIGHT, 5);
sb_content->Add(m_outer_title, 0, wxALL|wxALIGN_RIGHT, FromDIP(5));
m_outer_identity = new wxTTLSConfigPanel(m_prov, dynamic_cast<eap::config_method_ttls&>(m_cfg), this);
sb_content->Add(m_outer_identity, 0, wxALL|wxEXPAND, 5);
sb_content->Add(m_outer_identity, 0, wxALL|wxEXPAND, FromDIP(5));
m_tls = new wxTLSConfigPanel(m_prov, dynamic_cast<eap::config_method_tls&>(m_cfg), this);
sb_content->Add(m_tls, 0, wxALL|wxEXPAND, 5);
sb_content->Add(m_tls, 0, wxALL|wxEXPAND, FromDIP(5));
wxSize size = sb_content->CalcMin();
if (size.y > 500) {
if (size.y > FromDIP(500)) {
// Increase the width to allow space for vertical scroll bar (to prevent horizontal one) and truncate the height.
size.x += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this);
size.y = 500;
size.y = FromDIP(500);
}
this->SetMinSize(size);