Update Kicad window tooltips, etc. when language changes.

Fixes: lp:1828616
* https://bugs.launchpad.net/kicad/+bug/1828616
This commit is contained in:
Jeff Young 2019-05-17 01:29:55 +01:00
parent 6b3fe33d6f
commit 7452e98655
3 changed files with 30 additions and 9 deletions

View File

@ -40,11 +40,12 @@ const int BUTTON_SEPARATION = 5;
const int BUTTON_EXPANSION = 6; const int BUTTON_EXPANSION = 6;
LAUNCHER_PANEL::LAUNCHER_PANEL( wxWindow* parent ) : LAUNCHER_PANEL::LAUNCHER_PANEL( wxWindow* parent ) :
wxPanel( parent, wxID_ANY ) wxPanel( parent, wxID_ANY ),
m_buttonSizer( nullptr )
{ {
// Add bitmap buttons to launch KiCad utilities: // Add bitmap buttons to launch KiCad utilities:
CreateCommandToolbar(); ReCreateCommandToolbar();
} }
int LAUNCHER_PANEL::GetPanelHeight() const int LAUNCHER_PANEL::GetPanelHeight() const
@ -61,11 +62,17 @@ int LAUNCHER_PANEL::GetPanelWidth() const
* Add application launcher buttons * Add application launcher buttons
* e.g. Eeschema, CvPcb, Pcbnew, GerbView * e.g. Eeschema, CvPcb, Pcbnew, GerbView
*/ */
void LAUNCHER_PANEL::CreateCommandToolbar() void LAUNCHER_PANEL::ReCreateCommandToolbar()
{ {
wxStaticLine* separator; if( m_buttonSizer )
m_buttonSizer->Clear( true );
else
{
m_buttonSizer = new wxBoxSizer( wxHORIZONTAL );
SetSizer( m_buttonSizer );
}
m_buttonSizer = new wxBoxSizer( wxHORIZONTAL ); wxStaticLine* separator;
AddButton( ID_TO_SCH, AddButton( ID_TO_SCH,
KiBitmap( icon_eeschema_xpm ), KiBitmap( icon_eeschema_xpm ),
@ -111,7 +118,7 @@ void LAUNCHER_PANEL::CreateCommandToolbar()
// Add a stretchy spacer to make button bar fill the entire screen // Add a stretchy spacer to make button bar fill the entire screen
m_buttonSizer->AddStretchSpacer(); m_buttonSizer->AddStretchSpacer();
SetSizer( m_buttonSizer ); Layout();
} }
/** /**

View File

@ -233,6 +233,7 @@ public:
void SaveSettings( wxConfigBase* aCfg ) override; void SaveSettings( wxConfigBase* aCfg ) override;
void ShowChangedLanguage() override;
void CommonSettingsChanged() override; void CommonSettingsChanged() override;
/** /**
@ -323,13 +324,13 @@ public: LAUNCHER_PANEL( wxWindow* parent );
int GetPanelHeight() const; int GetPanelHeight() const;
int GetPanelWidth() const; int GetPanelWidth() const;
private:
/** /**
* Function CreateCommandToolbar * Function CreateCommandToolbar
* creates the main tool bar buttons (fast launch buttons) * creates the main tool bar buttons (fast launch buttons)
*/ */
void CreateCommandToolbar( void ); void ReCreateCommandToolbar();
private:
void AddButton( wxWindowID aId, const wxBitmap& aBitmap, const wxString& aToolTip ); void AddButton( wxWindowID aId, const wxBitmap& aBitmap, const wxString& aToolTip );
}; };

View File

@ -524,6 +524,19 @@ void KICAD_MANAGER_FRAME::language_change( wxCommandEvent& event )
} }
void KICAD_MANAGER_FRAME::ShowChangedLanguage()
{
// call my base class
EDA_BASE_FRAME::ShowChangedLanguage();
// tooltips in toolbars
RecreateBaseHToolbar();
m_Launcher->ReCreateCommandToolbar();
PrintPrjInfo();
}
void KICAD_MANAGER_FRAME::CommonSettingsChanged() void KICAD_MANAGER_FRAME::CommonSettingsChanged()
{ {
int historySize; int historySize;