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-08 17:30:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-08 17:35:05 +0300
commit1ce55693f511013ceed962e8614aa61dd2dff4d5 (patch)
tree7163824f8b2057d381287f260ad39c878e096958 /source/blender/editors/space_buttons/space_buttons.c
parent9d59d20957b5fe042f4132d9ed23e9ac25cb4ce0 (diff)
UI: remove tools space type, use properties context
We've decieded to use tools context in properties editor.
Diffstat (limited to 'source/blender/editors/space_buttons/space_buttons.c')
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 11857dd0b27..3787398c9e3 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -144,7 +144,6 @@ static void buttons_main_region_init(wmWindowManager *wm, ARegion *ar)
static void buttons_main_region_draw_properties(const bContext *C, SpaceButs *sbuts, ARegion *ar)
{
- BLI_assert(sbuts->space_subtype == SB_SUBTYPE_DATA);
const bool vertical = (sbuts->align == BUT_VERTICAL);
buttons_context_compute(C, sbuts);
@@ -197,6 +196,9 @@ static void buttons_main_region_draw_properties(const bContext *C, SpaceButs *sb
case BCONTEXT_BONE_CONSTRAINT:
contexts[0] = "bone_constraint";
break;
+ case BCONTEXT_TOOL:
+ contexts[0] = "tool";
+ break;
}
if (contexts[0]) {
@@ -206,7 +208,6 @@ 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)
{
- BLI_assert(sbuts->space_subtype == SB_SUBTYPE_TOOL);
const bool vertical = (sbuts->align == BUT_VERTICAL);
const WorkSpace *workspace = CTX_wm_workspace(C);
@@ -271,12 +272,12 @@ static void buttons_main_region_draw(const bContext *C, ARegion *ar)
/* draw entirely, view changes should be handled here */
SpaceButs *sbuts = CTX_wm_space_buts(C);
- if (sbuts->space_subtype == SB_SUBTYPE_DATA) {
- buttons_main_region_draw_properties(C, sbuts, ar);
- }
- else if (sbuts->space_subtype == SB_SUBTYPE_TOOL) {
+ if (sbuts->mainb == BCONTEXT_TOOL) {
buttons_main_region_draw_tool(C, sbuts, ar);
}
+ else {
+ buttons_main_region_draw_properties(C, sbuts, ar);
+ }
sbuts->re_align = 0;
sbuts->mainbo = sbuts->mainb;
@@ -320,10 +321,8 @@ static void buttons_header_region_draw(const bContext *C, ARegion *ar)
{
SpaceButs *sbuts = CTX_wm_space_buts(C);
- if (sbuts->space_subtype == SB_SUBTYPE_DATA) {
- /* Needed for RNA to get the good values! */
- buttons_context_compute(C, sbuts);
- }
+ /* Needed for RNA to get the good values! */
+ buttons_context_compute(C, sbuts);
ED_region_header(C, ar);
}
@@ -590,24 +589,6 @@ static void buttons_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id,
}
}
-static int buttons_space_subtype_get(ScrArea *sa)
-{
- SpaceButs *sbuts = sa->spacedata.first;
- return sbuts->space_subtype;
-}
-
-static void buttons_space_subtype_set(ScrArea *sa, int value)
-{
- SpaceButs *sbuts = sa->spacedata.first;
- sbuts->space_subtype = value;
-}
-
-static void buttons_space_subtype_item_extend(
- bContext *UNUSED(C), EnumPropertyItem **item, int *totitem)
-{
- RNA_enum_items_add(item, totitem, rna_enum_space_button_mode_items);
-}
-
/* only called once, from space/spacetypes.c */
void ED_spacetype_buttons(void)
{
@@ -626,9 +607,6 @@ void ED_spacetype_buttons(void)
st->listener = buttons_area_listener;
st->context = buttons_context;
st->id_remap = buttons_id_remap;
- st->space_subtype_item_extend = buttons_space_subtype_item_extend;
- st->space_subtype_get = buttons_space_subtype_get;
- st->space_subtype_set = buttons_space_subtype_set;
/* regions: main window */
art = MEM_callocN(sizeof(ARegionType), "spacetype buttons region");