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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-11 19:36:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-11 19:39:46 +0300
commit3df809958b785b91a7bf3c3e3d007fb91ea5804b (patch)
tree79c9b4c47f7fcb18c74f3b03a9001a74928ddd2d /source/blender/editors/space_buttons/space_buttons.c
parent3e1f83a1dc787ec518a6fa25a855f935b4a8b9b9 (diff)
WM: use layout/draw callbacks for buttons space
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c21
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);