From c90e05bb42668f0c99cf313b179c00a1380cb569 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 25 Oct 2009 03:47:14 +0000 Subject: [PATCH] Toolbar Fixes: * Restored the Grease Pencil tools to the toolbar Probably, if the reason they were commented out before was so that the repeat stuff is visible, we can swap the order of those two. Otherwise, it's good to have somewhere for the operators now (so that the hotkeys can be found) * Hotkey displays in the tooltips now show the keymodifier too For example, "D LeftMouse" or "Ctrl D LeftMouse" for the Grease Pencil operators, instead of just "LeftMouse" or "Ctrl LeftMouse". --- release/scripts/ui/space_view3d_toolbar.py | 80 +++++++++---------- .../blender/windowmanager/intern/wm_keymap.c | 5 ++ 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index a552bb7de14..65802744034 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -38,11 +38,11 @@ class VIEW3D_PT_tools_objectmode(View3DPanel): col.itemO("anim.insert_keyframe_menu", text="Insert") col.itemO("anim.delete_keyframe_v3d", text="Remove") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -91,11 +91,11 @@ class VIEW3D_PT_tools_meshedit(View3DPanel): col.itemO("mesh.uvs_rotate") col.itemO("mesh.uvs_mirror") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -150,11 +150,11 @@ class VIEW3D_PT_tools_curveedit(View3DPanel): col.itemO("curve.extrude") col.itemO("curve.subdivide") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -189,11 +189,11 @@ class VIEW3D_PT_tools_surfaceedit(View3DPanel): col.itemO("curve.extrude") col.itemO("curve.subdivide") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -252,11 +252,11 @@ class VIEW3D_PT_tools_armatureedit(View3DPanel): col.itemL(text="Modeling:") col.itemO("armature.extrude") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -282,11 +282,11 @@ class VIEW3D_PT_tools_mballedit(View3DPanel): col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -309,11 +309,11 @@ class VIEW3D_PT_tools_latticeedit(View3DPanel): col.itemO("tfm.rotate") col.itemO("tfm.resize", text="Scale") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") @@ -359,11 +359,11 @@ class VIEW3D_PT_tools_posemode(View3DPanel): col.itemO("pose.push", text="Push") col.itemO("pose.breakdown", text="Breakdowner") -# col = layout.column(align=True) -# col.itemL(text="Grease Pencil:") -# col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") -# col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") -# col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") + col = layout.column(align=True) + col.itemL(text="Grease Pencil:") + col.item_enumO("gpencil.draw", "mode", 'DRAW', text="Draw Freehand") + col.item_enumO("gpencil.draw", "mode", 'DRAW_STRAIGHT', text="Straight Line") + col.item_enumO("gpencil.draw", "mode", 'ERASER', text="Eraser") col = layout.column(align=True) col.itemL(text="Repeat:") diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 3caca041be7..48262e40ea7 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -306,6 +306,11 @@ char *WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, int len) if(kmi->oskey) strcat(buf, "Cmd "); + + if(kmi->keymodifier) { + strcat(buf, WM_key_event_string(kmi->keymodifier)); + strcat(buf, " "); + } strcat(buf, WM_key_event_string(kmi->type)); BLI_strncpy(str, buf, len);