Mark modified hotkeys in the hotkey editor
THis uses a simple " *" suffix, as the wxTreeListCtrl-derivative widget doesn't allow easy access to things like font style.
This commit is contained in:
parent
9f38b70491
commit
3283bd9fdc
|
@ -308,10 +308,17 @@ void WIDGET_HOTKEY_LIST::UpdateFromClientData()
|
|||
|
||||
if( hkdata )
|
||||
{
|
||||
const EDA_HOTKEY& hk = hkdata->GetChangedHotkey().GetCurrentValue();
|
||||
const auto& changed_hk = hkdata->GetChangedHotkey();
|
||||
const EDA_HOTKEY& hk = changed_hk.GetCurrentValue();
|
||||
|
||||
wxString key_text = KeyNameFromKeyCode( hk.m_KeyCode );
|
||||
|
||||
// mark unsaved changes
|
||||
if( changed_hk.HasUnsavedChange() )
|
||||
key_text += " *";
|
||||
|
||||
SetItemText( i, 0, wxGetTranslation( hk.m_InfoMsg ) );
|
||||
SetItemText( i, 1, KeyNameFromKeyCode( hk.m_KeyCode ) );
|
||||
SetItemText( i, 1, key_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,6 +71,15 @@ public:
|
|||
m_orig = m_changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return true if the hotkey doesn't match the original (i.e. it
|
||||
* has been changed)
|
||||
*/
|
||||
bool HasUnsavedChange() const
|
||||
{
|
||||
return m_orig.m_KeyCode != m_changed.m_KeyCode;
|
||||
}
|
||||
|
||||
const wxString& GetSectionTag() const
|
||||
{
|
||||
return m_tag;
|
||||
|
|
Loading…
Reference in New Issue