From 89f24fc457f938f561dfd52475dc4018349336af Mon Sep 17 00:00:00 2001 From: Paul Gilman Date: Thu, 16 Nov 2023 09:53:49 -0800 Subject: [PATCH] Fix text too long for config and navigation tree * Change font size from 13 to 12 * Hard code navigation tree width (needs testing on Mac and Linux) --- src/casewin.cpp | 9 ++++----- src/main.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/casewin.cpp b/src/casewin.cpp index 5ec506b8e9..926bf4ebc7 100644 --- a/src/casewin.cpp +++ b/src/casewin.cpp @@ -183,6 +183,7 @@ CaseWindow::CaseWindow( wxWindow *parent, Case *c ) // navigation menu objects m_left_panel = new wxPanel(this); m_left_panel->SetBackgroundColour( wxColour(100,100,100) ); + m_left_panel->SetMinSize(wxSize(250, 28)); // TODO size based on longest input page label m_inputPageList = new InputPageList( m_left_panel, ID_INPUTPAGELIST ); m_inputPageList->Show(false); @@ -191,12 +192,11 @@ CaseWindow::CaseWindow( wxWindow *parent, Case *c ) wxBoxSizer* szvl = new wxBoxSizer(wxVERTICAL); m_techLabel = new wxStaticText(m_left_panel, wxID_ANY, "-technology-"); - m_techLabel->SetBackgroundColour(tech_color); // TODO want this to apply color to tech panel background, not just label background + m_techLabel->SetBackgroundColour(tech_color); m_techLabel->SetForegroundColour(config_font_color); m_techLabel->SetFont(lafont); szvl->Add(m_techLabel, 0, wxEXPAND | wxALL, 0); - m_finLabel = new wxStaticText(m_left_panel, wxID_ANY, "-financial-"); m_finLabel->SetBackgroundColour(fin_color); // TODO want this to apply color to fin panel background, not just label background m_finLabel->SetForegroundColour(config_font_color); @@ -208,7 +208,7 @@ CaseWindow::CaseWindow( wxWindow *parent, Case *c ) wxBoxSizer* choice_sizer = new wxBoxSizer(wxHORIZONTAL); choice_sizer->Add(m_navigationMenu, 1, wxALL | wxEXPAND, 0); m_navigationMenu->SetBackgroundColour(wxColour(243, 243, 243)); - m_navigationMenu->SetFont(wxMetroTheme::Font(wxMT_LIGHT, 13)); + m_navigationMenu->SetFont(wxMetroTheme::Font(wxMT_LIGHT, 12)); szvl->Add(choice_sizer, 1, wxALL | wxEXPAND, 0); // box for simulation and results buttons @@ -1358,9 +1358,8 @@ void CaseWindow::UpdateConfiguration() m_case->BaseCase().Clear(); // reset for UpdateResults wxString Ts(SamApp::Config().Options(cfg->TechnologyFullName).ShortName); - - if ( Ts.IsEmpty() ) Ts = cfg->TechnologyFullName; + wxString Fs( SamApp::Config().Options( cfg->Financing ).ShortName ); if ( Fs.IsEmpty() ) Fs = cfg->Financing; diff --git a/src/main.cpp b/src/main.cpp index 8a9722c2e1..1882920998 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2771,8 +2771,12 @@ ConfigDialog::ConfigDialog( wxWindow *parent, const wxSize &size ) SetBackgroundColour( wxMetroTheme::Colour( wxMT_FOREGROUND ) ); CenterOnParent(); + wxFont font(wxMetroTheme::Font(wxMT_NORMAL, 12)); + m_pTech = new wxMetroDataViewTreeCtrl(this, ID_TechTree); - m_pFin = new wxMetroDataViewTreeCtrl(this, ID_FinTree); + m_pTech->SetFont(font); + m_pFin = new wxMetroDataViewTreeCtrl(this, ID_FinTree); + m_pFin->SetFont(font); wxBoxSizer *choice_sizer = new wxBoxSizer( wxHORIZONTAL ); choice_sizer->Add( m_pTech, 1, wxALL|wxEXPAND, 0 ); @@ -2780,7 +2784,6 @@ ConfigDialog::ConfigDialog( wxWindow *parent, const wxSize &size ) wxStaticText *label = new wxStaticText( this, wxID_ANY, "Choose a performance model, and then choose from the available financial models." ); - wxFont font( wxMetroTheme::Font( wxMT_NORMAL, 12 ) ); label->SetFont( font ); label->SetForegroundColour( *wxWHITE );