[Bf-blender-cvs] [7ff0f896e85] master: UI: Use different icon to remove user-created shortcuts in Preferences

Julian Eisel noreply at git.blender.org
Mon Apr 20 15:57:39 CEST 2020


Commit: 7ff0f896e8578bbea87b6619f5905a98f97331ff
Author: Julian Eisel
Date:   Mon Apr 20 15:46:10 2020 +0200
Branches: master
https://developer.blender.org/rB7ff0f896e8578bbea87b6619f5905a98f97331ff

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}

===================================================================

M	release/scripts/modules/rna_keymap_ui.py

===================================================================

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:



More information about the Bf-blender-cvs mailing list