diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index be687d365f3..f322801b122 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -144,7 +144,7 @@ static void buttons_main_region_init(wmWindowManager *wm, ARegion *ar) WM_event_add_keymap_handler(&ar->handlers, keymap); } -static void buttons_main_region_draw_properties(const bContext *C, SpaceButs *sbuts, ARegion *ar) +static void buttons_main_region_layout_properties(const bContext *C, SpaceButs *sbuts, ARegion *ar) { const bool vertical = (sbuts->align == BUT_VERTICAL); @@ -208,7 +208,7 @@ static void buttons_main_region_draw_properties(const bContext *C, SpaceButs *sb } } -static void buttons_main_region_draw_tool(const bContext *C, SpaceButs *sbuts, ARegion *ar) +static void buttons_main_region_layout_tool(const bContext *C, SpaceButs *sbuts, ARegion *ar) { const bool vertical = (sbuts->align == BUT_VERTICAL); const char *contexts[3] = {NULL}; @@ -260,30 +260,24 @@ static void buttons_main_region_draw_tool(const bContext *C, SpaceButs *sbuts, A ARRAY_SET_ITEMS(contexts, ".todo"); break; } - if (contexts[0]) { - ED_region_panels(C, ar, contexts, -1, vertical); - } } else if (workspace->tools_space_type == SPACE_IMAGE) { /* TODO */ } - if (contexts[0] == NULL) { - UI_ThemeClearColor(TH_BACK); - glClear(GL_COLOR_BUFFER_BIT); - } + ED_region_panels_layout(C, ar, contexts, -1, vertical); } -static void buttons_main_region_draw(const bContext *C, ARegion *ar) +static void buttons_main_region_layout(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ SpaceButs *sbuts = CTX_wm_space_buts(C); if (sbuts->mainb == BCONTEXT_TOOL) { - buttons_main_region_draw_tool(C, sbuts, ar); + buttons_main_region_layout_tool(C, sbuts, ar); } else { - buttons_main_region_draw_properties(C, sbuts, ar); + buttons_main_region_layout_properties(C, sbuts, ar); } sbuts->re_align = 0; @@ -619,7 +613,8 @@ void ED_spacetype_buttons(void) art = MEM_callocN(sizeof(ARegionType), "spacetype buttons region"); art->regionid = RGN_TYPE_WINDOW; art->init = buttons_main_region_init; - art->draw = buttons_main_region_draw; + art->layout = buttons_main_region_layout; + art->draw = ED_region_panels_draw; art->listener = buttons_main_region_listener; art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES; BLI_addhead(&st->regiontypes, art); |