Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-19 04:55:30 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-19 04:55:30 +0400
commit184ac26dd0187d70985cdc49ae527a1900fce840 (patch)
tree7b946acb11e0a430b61e2f608e0308a1b18439d7 /source/blender/editors/space_text
parente21c1dde810b3447eaa1f6a667ae027978b18d9b (diff)
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.
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_header.c23
1 files changed, 12 insertions, 11 deletions
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;
}