Toolbar Fixes:
authorJoshua Leung <aligorith@gmail.com>
Sun, 25 Oct 2009 03:47:14 +0000 (03:47 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 25 Oct 2009 03:47:14 +0000 (03:47 +0000)
* 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
source/blender/windowmanager/intern/wm_keymap.c

index a552bb7de14fade380054523cc7b05d028b2b027..65802744034ec315329a4a6e6ac2649288a0bae5 100644 (file)
@@ -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:")
index 3caca041be79ea4d722c039a032c012a70b01207..48262e40ea75ac560d1a4a92cbfb92a731800fe0 100644 (file)
@@ -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);