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/editors/space_outliner | |
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/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 6380bb9505e..f8812ff5970 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1105,6 +1105,24 @@ bPoseChannel *outliner_find_parent_bone(TreeElement *te, TreeElement **r_bone_te return NULL; } +static void outliner_sync_to_properties_editors(const bContext *C, + PointerRNA *ptr, + const int context) +{ + bScreen *screen = CTX_wm_screen(C); + + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + if (area->spacetype != SPACE_PROPERTIES) { + continue; + } + + SpaceProperties *sbuts = (SpaceProperties *)area->spacedata.first; + if (ED_buttons_should_sync_with_outliner(C, sbuts, area)) { + ED_buttons_set_context(C, sbuts, ptr, context); + } + } +} + static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreElem *tselem) { PointerRNA ptr = {0}; @@ -1285,7 +1303,7 @@ static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreE } if (ptr.data) { - ED_buttons_set_context(C, &ptr, context); + outliner_sync_to_properties_editors(C, &ptr, context); } } |