From a9bf6a3b3adfce31a230f10c00a0a89cf2d7e985 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Nov 2018 07:52:34 +1100 Subject: [PATCH] UI: hide keymap preferences when filter is used --- release/scripts/modules/rna_keymap_ui.py | 51 ++++++++++++------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py index a1afca914aa..756dbde23c9 100644 --- a/release/scripts/modules/rna_keymap_ui.py +++ b/release/scripts/modules/rna_keymap_ui.py @@ -406,30 +406,31 @@ def draw_keymaps(context, layout): rowsubsub.alert = True rowsubsub.prop(spref, "filter_text", text="", icon='VIEWZOOM') - # When the keyconfig defines it's own preferences. - kc_prefs = kc_active.preferences - if kc_prefs is not None: - box = col.box() - row = box.row(align=True) + if not filter_text: + # When the keyconfig defines it's own preferences. + kc_prefs = kc_active.preferences + if kc_prefs is not None: + box = col.box() + row = box.row(align=True) - userpref = context.user_preferences - inputs = userpref.inputs - show_ui_keyconfig = inputs.show_ui_keyconfig - row.prop( - inputs, - "show_ui_keyconfig", - text="", - icon='TRIA_DOWN' if show_ui_keyconfig else 'TRIA_RIGHT', - emboss=False, - ) - row.label(text="Preferences") + userpref = context.user_preferences + inputs = userpref.inputs + show_ui_keyconfig = inputs.show_ui_keyconfig + row.prop( + inputs, + "show_ui_keyconfig", + text="", + icon='TRIA_DOWN' if show_ui_keyconfig else 'TRIA_RIGHT', + emboss=False, + ) + row.label(text="Preferences") - if show_ui_keyconfig: - # Defined by user preset, may contain mistakes out of our control. - try: - kc_prefs.draw(box) - except Exception: - import traceback - traceback.print_exc() - del box - del kc_prefs + if show_ui_keyconfig: + # Defined by user preset, may contain mistakes out of our control. + try: + kc_prefs.draw(box) + except Exception: + import traceback + traceback.print_exc() + del box + del kc_prefs