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:
authorGeorge Vogiatzis <Gvgeo>2019-04-05 14:48:26 +0300
committerJacques Lucke <mail@jlucke.com>2019-04-05 14:48:26 +0300
commita180b754eb40637a5d37eeb0ae60066f5a6f93d8 (patch)
tree3871e253a8f3b861b27dfd3f666535adffc606b0 /source/blender/editors/space_text/space_text.c
parentfce469a30c5075216671f9ce3738ed401ad9c03f (diff)
Interface: New region type 'Footer', used by text editor
* It can be hidden by dragging it up/down. * It can be at the top or bottom, independent of the header. * It uses the color theme from the header. * It does not change its color, when the area becomes active. Currently, it is used in the text editor to display the file path. Differential Revision: https://developer.blender.org/D4601
Diffstat (limited to 'source/blender/editors/space_text/space_text.c')
-rw-r--r--source/blender/editors/space_text/space_text.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index cd5b3facfe9..55165e4840f 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -74,6 +74,12 @@ static SpaceLink *text_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen
ar->regiontype = RGN_TYPE_HEADER;
ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
+ /* footer */
+ ar = MEM_callocN(sizeof(ARegion), "footer for text");
+ BLI_addtail(&stext->regionbase, ar);
+ ar->regiontype = RGN_TYPE_FOOTER;
+ ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_TOP : RGN_ALIGN_BOTTOM;
+
/* properties region */
ar = MEM_callocN(sizeof(ARegion), "properties region for text");
@@ -469,7 +475,15 @@ void ED_spacetype_text(void)
art->init = text_header_region_init;
art->draw = text_header_region_draw;
+ BLI_addhead(&st->regiontypes, art);
+ /* regions: footer */
+ art = MEM_callocN(sizeof(ARegionType), "spacetype text region");
+ art->regionid = RGN_TYPE_FOOTER;
+ art->prefsizey = HEADERY;
+ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FOOTER;
+ art->init = text_header_region_init;
+ art->draw = text_header_region_draw;
BLI_addhead(&st->regiontypes, art);
BKE_spacetype_register(st);