Skip to content

Commit

Permalink
Fix text too long for config and navigation tree
Browse files Browse the repository at this point in the history
* Change font size from 13 to 12
* Hard code navigation tree width (needs testing on Mac and Linux)
  • Loading branch information
cpaulgilman committed Nov 16, 2023
1 parent d4838c1 commit 89f24fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/casewin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down
7 changes: 5 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2771,16 +2771,19 @@ 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 );
choice_sizer->Add( m_pFin, 1, wxALL|wxEXPAND, 0 );

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 );

Expand Down

0 comments on commit 89f24fc

Please sign in to comment.