def draw_keymaps(self, context, layout): from bpy_extras import keyconfig_utils wm = context.window_manager kc = wm.keyconfigs.user col = layout.column() sub = col.column() subsplit = sub.split() subcol = subsplit.column() row = subcol.row(align=True) #~ row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:") text = bpy.path.display_name(context.window_manager.keyconfigs.active.name) if not text: text = "Blender (default)" row.menu("USERPREF_MT_keyconfigs", text=text) row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMIN') row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMOUT').remove_active = True #~ layout.context_pointer_set("keyconfig", wm.keyconfigs.active) #~ row.operator("wm.keyconfig_remove", text="", icon='X') row.prop(context.space_data, "filter_text", icon='VIEWZOOM') col.separator() display_keymaps = keyconfig_utils.keyconfig_merge(kc, kc) if context.space_data.filter_text != "": filter_text = context.space_data.filter_text.lower() self.draw_filtered(display_keymaps, filter_text, col) else: self.draw_hierarchy(display_keymaps, col)
def draw_keymaps(self, context, layout): from bpy_extras import keyconfig_utils wm = context.window_manager kc = wm.keyconfigs.user spref = context.space_data col = layout.column() sub = col.column() subsplit = sub.split() subcol = subsplit.column() row = subcol.row(align=True) #~ row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config:") text = bpy.path.display_name(wm.keyconfigs.active.name) if not text: text = "Blender (default)" row.menu("USERPREF_MT_keyconfigs", text=text) row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMIN') row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMOUT').remove_active = True #~ layout.context_pointer_set("keyconfig", wm.keyconfigs.active) #~ row.operator("wm.keyconfig_remove", text="", icon='X') row.separator() rowsub = row.split(align=True, percentage=0.33) # postpone drawing into rowsub, so we can set alert! col.separator() display_keymaps = keyconfig_utils.keyconfig_merge(kc, kc) filter_type = spref.filter_type filter_text = spref.filter_text.strip() if filter_text: filter_text = filter_text.lower() ok = self.draw_filtered(display_keymaps, filter_type, filter_text, col) else: self.draw_hierarchy(display_keymaps, col) ok = True # go back and fill in rowsub rowsub.prop(spref, "filter_type", text="") rowsubsub = rowsub.row(align=True) if not ok: rowsubsub.alert = True rowsubsub.prop(spref, "filter_text", text="", icon='VIEWZOOM')
def draw_keymaps(context, layout): from bpy_extras import keyconfig_utils wm = context.window_manager kc = wm.keyconfigs.user spref = context.space_data col = layout.column() sub = col.column() subsplit = sub.split() subcol = subsplit.column() row = subcol.row(align=True) #~ row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config") text = bpy.path.display_name(wm.keyconfigs.active.name) if not text: text = "Blender (default)" row.menu("USERPREF_MT_keyconfigs", text=text) row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMIN') row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMOUT').remove_active = True #~ layout.context_pointer_set("keyconfig", wm.keyconfigs.active) #~ row.operator("wm.keyconfig_remove", text="", icon='X') row.separator() rowsub = row.split(align=True, percentage=0.33) # postpone drawing into rowsub, so we can set alert! col.separator() display_keymaps = keyconfig_utils.keyconfig_merge(kc, kc) filter_type = spref.filter_type filter_text = spref.filter_text.strip() if filter_text: filter_text = filter_text.lower() ok = draw_filtered(display_keymaps, filter_type, filter_text, col) else: draw_hierarchy(display_keymaps, col) ok = True # go back and fill in rowsub rowsub.prop(spref, "filter_type", text="") rowsubsub = rowsub.row(align=True) if not ok: rowsubsub.alert = True rowsubsub.prop(spref, "filter_text", text="", icon='VIEWZOOM')