diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-18 22:13:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-19 07:53:38 +0300 |
commit | 9573bf432c4b06d940b4b38cc455826f47518884 (patch) | |
tree | 6e8d4136abfbbd953423b1b6948ab64f11187eee /source/blender/editors/space_image/space_image.c | |
parent | 638938e5a8c30c405c3b4e96ab4f78095003958b (diff) |
UI: move top-bar into the spaces header
Currently this is only in the 3D viewport however all spaces
that use the tool-system will have this region added.
D4680 by @brecht with own updates.
Diffstat (limited to 'source/blender/editors/space_image/space_image.c')
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index ded19b10300..1e1d1e570b3 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -134,6 +134,13 @@ static SpaceLink *image_new(const ScrArea *UNUSED(area), const Scene *UNUSED(sce scopes_new(&simage->scopes); simage->sample_line_hist.height = 100; + /* tool header */ + ar = MEM_callocN(sizeof(ARegion), "tool header for image"); + + BLI_addtail(&simage->regionbase, ar); + ar->regiontype = RGN_TYPE_TOOL_HEADER; + ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; + /* header */ ar = MEM_callocN(sizeof(ARegion), "header for image"); @@ -1033,6 +1040,17 @@ void ED_spacetype_image(void) art->draw = image_tools_region_draw; BLI_addhead(&st->regiontypes, art); + /* regions: tool header */ + art = MEM_callocN(sizeof(ARegionType), "spacetype image tool header region"); + art->regionid = RGN_TYPE_TOOL_HEADER; + art->prefsizey = HEADERY; + art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER; + art->listener = image_header_region_listener; + art->init = image_header_region_init; + art->draw = image_header_region_draw; + art->message_subscribe = ED_area_do_mgs_subscribe_for_tool_header; + BLI_addhead(&st->regiontypes, art); + /* regions: header */ art = MEM_callocN(sizeof(ARegionType), "spacetype image region"); art->regionid = RGN_TYPE_HEADER; |