2.5: Fixes
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 10 Aug 2009 20:57:12 +0000 (20:57 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 10 Aug 2009 20:57:12 +0000 (20:57 +0000)
* Disable shaded mode for now, it cause too many crashes combined
  with preview render, will be fixed properly later.
* Make 3d view toolbar region a bit wider. Ideally this would not
  be needed, but the sculpt/paint buttons just don't fit otherwise.
* Revert change to icon/text spacing in buttons, it breaks text
  editing and clipping. Will properly fix this later so changing
  the spacing can be done centrally.
* Fix for grease pencil simplify stroke python error. Now button
  is hidden (as in 2.4), but still available through outliner.
* Fix for memory leak in UI code, when using ctrl+Q menu.
* Fix submenu > icon being drawn on some buttons where it was not
  needed.

release/ui/space_info.py
source/blender/blenkernel/intern/displist.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesrna/intern/rna_userdef.c

index 686600ba4e75751f86e4315ca7647e1152b9c0ef..9c08a0fe3d2ec0b9a865a51482756179663888e4 100644 (file)
@@ -335,7 +335,7 @@ class INFO_PT_edit(bpy.types.Panel):
                colsplitcol.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
                colsplitcol.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
                colsplitcol.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
-               colsplitcol.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
+               colsplitcol.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
                colsplitcol.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
                
                
index cdf4b90cee199ef438ae4bbc642ae872f7f5ad9f..069129c15da2b81df573f3668a2fff8aebe802dd 100644 (file)
@@ -315,6 +315,9 @@ static void init_fastshade_shadeinput(Render *re)
 
 static Render *fastshade_get_render(Scene *scene)
 {
+       // XXX 2.5: this crashes combined with previewrender
+       // due to global R so disabled for now
+#if 0
        /* XXX ugly global still, but we can't do preview while rendering */
        if(G.rendering==0) {
                
@@ -326,6 +329,7 @@ static Render *fastshade_get_render(Scene *scene)
                }
                return re;
        }
+#endif
        
        return NULL;
 }
index f3bb975a1f7225065986f9710450331616b19ea5..1c58d087ec43b1b8aaeea7470bb14150036516af 100644 (file)
@@ -2953,7 +2953,6 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int
        but->flag|= UI_HAS_ICON;
        
        but->flag|= UI_ICON_LEFT;
-       but->flag|= UI_ICON_SUBMENU;
        
        but->block_create_func= func;
        ui_check_but(but);
index 30cfafb24f8870e3b8ed7130ee80a8c7b3374da8..6f438edc9662cd863b16fe12b55375f47a666266 100644 (file)
@@ -315,6 +315,7 @@ static void ui_apply_autokey_undo(bContext *C, uiBut *but)
 static void ui_apply_but_funcs_after(bContext *C)
 {
        uiAfterFunc *afterf, after;
+       PointerRNA opptr;
        ListBase funcs;
 
        /* copy to avoid recursive calls */
@@ -328,13 +329,18 @@ static void ui_apply_but_funcs_after(bContext *C)
                if(after.context)
                        CTX_store_set(C, after.context);
 
-               if(after.optype)
-                       WM_operator_name_call(C, after.optype->idname, after.opcontext, after.opptr);
                if(after.opptr) {
-                       WM_operator_properties_free(after.opptr);
+                       /* free in advance to avoid leak on exit */
+                       opptr= *after.opptr,
                        MEM_freeN(after.opptr);
                }
 
+               if(after.optype)
+                       WM_operator_name_call(C, after.optype->idname, after.opcontext, (after.opptr)? &opptr: NULL);
+
+               if(after.opptr)
+                       WM_operator_properties_free(&opptr);
+
                if(after.rnapoin.data)
                        RNA_property_update(C, &after.rnapoin, after.rnaprop);
 
index 6932ad350b001ad38bac3838a61c7e279ee2490c..b90d930475a6a688e93bfc2a15f59c8d1ac76a83 100644 (file)
@@ -222,9 +222,9 @@ static int ui_text_icon_width(uiLayout *layout, char *name, int icon)
        if(icon && !name[0])
                return UI_UNIT_X; /* icon only */
        else if(icon)
-               return (variable)? UI_GetStringWidth(name) + 4 + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
+               return (variable)? UI_GetStringWidth(name) + 10 + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */
        else
-               return (variable)? UI_GetStringWidth(name) + 4 + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
+               return (variable)? UI_GetStringWidth(name) + 10 + UI_UNIT_X: 10*UI_UNIT_X; /* text only */
 }
 
 static void ui_item_size(uiItem *item, int *r_w, int *r_h)
index eed4425b7ad9ed5fe614721077f565c543e2c34b..cea3038b901fd69caf0bd2a65c473bbdc5ae4a28 100644 (file)
@@ -889,7 +889,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
                        rect->xmin += UI_icon_get_width(but->icon+but->iconadd);
                        
                        if(but->editstr || (but->flag & UI_TEXT_LEFT)) 
-                               rect->xmin += 10;
+                               rect->xmin += 5;
                }
                else if((but->flag & UI_TEXT_LEFT)) 
                        rect->xmin += 5;
index e1f0b537241841a38099187985080eb63d97eec5..48ea5cf5df25238f9548178f601fce04cee0a152 100644 (file)
@@ -889,7 +889,7 @@ void ED_spacetype_view3d(void)
        /* regions: tool(bar) */
        art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region");
        art->regionid = RGN_TYPE_TOOLS;
-       art->minsizex= 120; // XXX
+       art->minsizex= 160; // XXX
        art->minsizey= 50; // XXX
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES;
        art->listener= view3d_buttons_area_listener;
index 8dcca4465077c7f237956900d7ff071a5de54315..42f22ba365746729567a850b2e5dc064a5f2723e 100644 (file)
@@ -1826,11 +1826,9 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
        RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke.");
 
-#if 0
        prop= RNA_def_property(srna, "grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
        RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke.");
-#endif
 
        prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "gp_eraser");