diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-01-27 13:04:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-01-27 13:04:21 +0300 |
commit | 5d6d5b7272596ef58dbaa06327f0fe1720d66158 (patch) | |
tree | 4e17bd15e454daec68f116f842a3d65b899b02a8 /source/blender/makesrna | |
parent | 4aa286d788d88d0cd59d80e5e5d5eed947b3206d (diff) |
Fix T46624: Preview is not always correctly updated
It is possible that preview was not updated to correspond a
new context when width of preview is the same for two contexts.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index df5bbe86dad..52b84fa4a45 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1102,6 +1102,14 @@ static EnumPropertyItem *rna_SpaceProperties_context_itemf(bContext *UNUSED(C), return item; } +static void rna_SpaceProperties_context_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + SpaceButs *sbuts = (SpaceButs *)(ptr->data); + if (ELEM(sbuts->mainb, BCONTEXT_WORLD, BCONTEXT_MATERIAL, BCONTEXT_TEXTURE)) { + sbuts->preview = 1; + } +} + static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) { SpaceButs *sbuts = (SpaceButs *)(ptr->data); @@ -2845,7 +2853,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) RNA_def_property_enum_items(prop, buttons_context_items); RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", "rna_SpaceProperties_context_itemf"); RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_context_update"); prop = RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align"); |