UI: Use different icon to remove user-created shortcuts in Preferences

There was no way for users to visually tell appart shortcut items
they've added themselves and the default ones. Both used the same 'x'
icon to remove the item.
Modified items already showed a back-arrow icon; this commit makes
user-created shortcuts use an icon that has both, a back-arrow and a
'x'.

The icon is in fact from the Movie Clip Editor, but William Reynish and
I concluded that it's not worth creating and adding a new one just to
short-term fix this small annoyance. And the icon actually fits the
purpose surprisingly well :) {F8485176}
This commit is contained in:
Julian Eisel 2020-04-20 15:46:10 +02:00
parent 8dbbac43bb
commit 7ff0f896e8
1 changed files with 6 additions and 1 deletions

View File

@ -161,7 +161,12 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
if (not kmi.is_user_defined) and kmi.is_user_modified:
row.operator("preferences.keyitem_restore", text="", icon='BACK').item_id = kmi.id
else:
row.operator("preferences.keyitem_remove", text="", icon='X').item_id = kmi.id
row.operator(
"preferences.keyitem_remove",
text="",
# Abusing the tracking icon, but it works pretty well here.
icon=('TRACKING_CLEAR_BACKWARDS' if kmi.is_user_defined else 'X')
).item_id = kmi.id
# Expanded, additional event settings
if kmi.show_expanded: