From 184ac26dd0187d70985cdc49ae527a1900fce840 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 19 Aug 2009 00:55:30 +0000 Subject: 2.5: Headers * Fix header menu spacing bug, and make it consistent for all headers. * For consistency, always put menus first in the header, then any enums to switch the type of data displayed. * Node editor header ported to python layout. Still quite a few operators missing to make the menus complete. * RNA wrapped node editor, and added use_nodes property to material and scene. --- source/blender/editors/space_text/text_header.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/space_text/text_header.c') diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index c761587198f..0e2d2ce1698 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -186,12 +186,18 @@ ARegion *text_has_properties_region(ScrArea *sa) return arnew; } -static int properties_poll(bContext *C) +void text_toggle_properties_region(bContext *C, ScrArea *sa, ARegion *ar) { - SpaceText *st= CTX_wm_space_text(C); - Text *text= CTX_data_edit_text(C); + ar->flag ^= RGN_FLAG_HIDDEN; + ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ + + ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); + ED_area_tag_redraw(sa); +} - return (st && text); +static int properties_poll(bContext *C) +{ + return (CTX_wm_space_text(C) != NULL); } static int properties_exec(bContext *C, wmOperator *op) @@ -199,13 +205,8 @@ static int properties_exec(bContext *C, wmOperator *op) ScrArea *sa= CTX_wm_area(C); ARegion *ar= text_has_properties_region(sa); - if(ar) { - ar->flag ^= RGN_FLAG_HIDDEN; - ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ - - ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); - ED_area_tag_redraw(sa); - } + if(ar) + text_toggle_properties_region(C, sa, ar); return OPERATOR_FINISHED; } -- cgit v1.2.3