From ac2451c6be437fba14f9c0ceeeaeab382fd9ad58 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 18 Aug 2009 12:56:43 +0000 Subject: 2.5: RNA. Default values were not set when calling functions, this is fixed now. Also added option for spaces without menus in the header in uiTemplateHeader. --- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface_templates.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cc3b243d38d..8da2702b603 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -625,7 +625,7 @@ uiLayout *uiLayoutSplit(uiLayout *layout, float percentage); uiBlock *uiLayoutFreeBlock(uiLayout *layout); /* templates */ -void uiTemplateHeader(uiLayout *layout, struct bContext *C); +void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus); void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop); uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1a5c1178983..0ee21cbcf77 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -56,12 +56,13 @@ void ui_template_fix_linking() /********************** Header Template *************************/ -void uiTemplateHeader(uiLayout *layout, bContext *C) +void uiTemplateHeader(uiLayout *layout, bContext *C, int menus) { uiBlock *block; block= uiLayoutFreeBlock(layout); - ED_area_header_standardbuttons(C, block, 0); + if(menus) ED_area_header_standardbuttons(C, block, 0); + else ED_area_header_switchbutton(C, block, 0); } /********************** Search Callbacks *************************/ -- cgit v1.2.3