diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-12-22 00:27:09 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-12-22 00:31:32 +0300 |
commit | ffacce5be41df68658f8478fee73e74701d2b545 (patch) | |
tree | 71981b37cedbb77b002ae27511471c96c63597b8 /source/blender/makesrna | |
parent | 2d6e6d035b664d6244fd48090cb8545145032f9f (diff) |
UI: Properties editor popover and outliner sync
This adds a popover to the properties editor. Currently the only setting
is for controlling outliner to properties syncing.
Because we cannot define a perfect heuristic to determine when
properties editors should change tabs based on outliner icon selection,
we need an option to enable or disable this behavior per properties
editor.
There are 3 options for controlling the syncing. Auto uses the heuristic
to only allow tab switching when a properties editor and outliner share
a border. On and off enable and disable syncing respectively.
Differential Revision: https://developer.blender.org/D9758
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index acfb317c616..fb8f472ad76 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -4776,6 +4776,17 @@ static void rna_def_space_properties(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static const EnumPropertyItem tab_sync_items[] = { + {PROPERTIES_SYNC_ON, "ON", 0, "On", "Always sync from outliner editors to this editor"}, + {PROPERTIES_SYNC_OFF, "OFF", 0, "Off", "Never sync from outliner editors to this editor"}, + {PROPERTIES_SYNC_AUTO, + "AUTO", + 0, + "Auto", + "Sync when this editor shares an edge with an outliner editor"}, + {0, NULL, 0, NULL, NULL}, + }; + srna = RNA_def_struct(brna, "SpaceProperties", "Space"); RNA_def_struct_sdna(srna, "SpaceProperties"); RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data"); @@ -4826,6 +4837,13 @@ static void rna_def_space_properties(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_TEXTEDIT_UPDATE); RNA_def_property_update( prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_SpaceProperties_search_filter_update"); + + /* Outliner sync. */ + prop = RNA_def_property(srna, "outliner_sync", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "outliner_sync"); + RNA_def_property_enum_items(prop, tab_sync_items); + RNA_def_property_ui_text(prop, "Outliner Sync", "Sync tabs from outliner datablock selection"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, NULL); } static void rna_def_space_image_overlay(BlenderRNA *brna) |