Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-04-20 16:46:10 +0300
committerJulian Eisel <julian@blender.org>2020-04-20 16:56:57 +0300
commit7ff0f896e8578bbea87b6619f5905a98f97331ff (patch)
tree362059e7478576b2edc9ad41936ca3c6948d3669 /release
parent8dbbac43bb38442e69e8dcd6a02c424ffb7855df (diff)
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}
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/rna_keymap_ui.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py
index 22be5186186..844daded570 100644
--- a/release/scripts/modules/rna_keymap_ui.py
+++ b/release/scripts/modules/rna_keymap_ui.py
@@ -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: