Add tooltips to hotkey dialog buttons
THis is done in the generic widget, so other users can benefit from it.
This commit is contained in:
parent
23038b1550
commit
7c2c8d307e
|
@ -101,6 +101,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
|||
{
|
||||
wxID_RESET,
|
||||
_( "Reset Hotkeys" ),
|
||||
_( "Undo all changes made so far in this dialog" ),
|
||||
[this]( wxCommandEvent ){
|
||||
m_hotkeyListCtrl->ResetAllHotkeys( false );
|
||||
}
|
||||
|
@ -108,6 +109,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
|||
{
|
||||
wxID_ANY,
|
||||
_( "Set to Defaults" ),
|
||||
_( "Set all hotkeys to the built-in KiCad defaults" ),
|
||||
[this]( wxCommandEvent ){
|
||||
m_hotkeyListCtrl->ResetAllHotkeys( true );
|
||||
}
|
||||
|
@ -118,6 +120,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
|||
{
|
||||
wxID_ANY,
|
||||
_( "Import..." ),
|
||||
_( "Import hotkey definitions from an external file, replacing the current values" ),
|
||||
[this]( wxCommandEvent ){
|
||||
m_frame->ImportHotkeyConfigFromFile( m_hotkeys, m_nickname );
|
||||
}
|
||||
|
@ -125,6 +128,7 @@ void PANEL_HOTKEYS_EDITOR::installButtons( wxSizer* aSizer )
|
|||
{
|
||||
wxID_ANY,
|
||||
_( "Export..." ),
|
||||
_( "Export these hotkey definitions to an external file" ),
|
||||
[this]( wxCommandEvent ){
|
||||
m_frame->ExportHotkeyConfigToFile( m_hotkeys, m_nickname );
|
||||
}
|
||||
|
|
|
@ -68,6 +68,8 @@ void BUTTON_ROW_PANEL::addButtons( bool aLeft, const BTN_DEF_LIST& aDefs )
|
|||
if( ( aLeft ) || ( !aLeft && i < aDefs.size() - 1 ) )
|
||||
this_style |= wxRIGHT;
|
||||
|
||||
btn->SetToolTip( def.m_tooltip );
|
||||
|
||||
m_sizer->Add( btn, btn_proportion, this_style, btn_margin );
|
||||
|
||||
btn->Bind( wxEVT_COMMAND_BUTTON_CLICKED, def.m_callback );
|
||||
|
|
|
@ -63,6 +63,11 @@ public:
|
|||
*/
|
||||
wxString m_text;
|
||||
|
||||
/**
|
||||
* Button tooltip text - empty string for no tooltip
|
||||
*/
|
||||
wxString m_tooltip;
|
||||
|
||||
/**
|
||||
* The callback fired when the button is clicked. Can be nullptr,
|
||||
* but then the button is useless.
|
||||
|
|
Loading…
Reference in New Issue