[Bf-blender-cvs] [d5c751012b3] blender2.8: UI: show active keymap user preferences

Campbell Barton noreply at git.blender.org
Sun Nov 18 02:33:10 CET 2018


Commit: d5c751012b3f275d09b10601af1c7ebe6dfb6837
Author: Campbell Barton
Date:   Sun Nov 18 12:31:36 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBd5c751012b3f275d09b10601af1c7ebe6dfb6837

UI: show active keymap user preferences

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

M	release/scripts/startup/bl_ui/space_userpref.py

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index db0dc25f430..5a71f98d8f8 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -1069,6 +1069,20 @@ class USERPREF_PT_input(Panel):
         userpref = context.user_preferences
         return (userpref.active_section == 'INPUT')
 
+    @staticmethod
+    def draw_input_prefs_keyconfig(context, layout):
+        kc = context.window_manager.keyconfigs.active
+        kc_prefs = kc.preferences
+        if kc_prefs is not None:
+            box = layout.box()
+            box.label(text=kc.name.replace("_", " ").title() + " Keymap Options")
+            # Defined by user preset, may contain mistakes out of our control.
+            try:
+                kc_prefs.draw(box)
+            except Exception:
+                import traceback
+                traceback.print_exc()
+
     @staticmethod
     def draw_input_prefs(inputs, layout):
         import sys
@@ -1190,6 +1204,9 @@ class USERPREF_PT_input(Panel):
         # Input settings
         self.draw_input_prefs(inputs, col)
 
+        # When the keyconfig defines it's own preferences.
+        self.draw_input_prefs_keyconfig(context, col)
+
         row.separator()
 
         # Keymap Settings



More information about the Bf-blender-cvs mailing list