diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-12-07 04:35:17 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-12-07 04:40:29 +0300 |
commit | 892a104d2cc322cb042a687050dcce2403a971f3 (patch) | |
tree | 93fccddcd97e5b60988351d1b6e8954a9910558c /source/blender/editors/space_buttons | |
parent | 497a9ef7a39608d62df83c10e209f22809e94e6e (diff) |
Fix T58904: Side tabs disappear when creating new View Layer
Using listener here, although I suspect we should be using message
subscriber only. That said, this mimics the behaviour of the buttons
main region.
As for the original bug report what was happening was that when
switching between viewlayers (or when creating one) we may not get the
same active object. So the context breadcrumbs are different.
And the bug itself was that we were missing a redraw on view layer
change.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/space_buttons.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 1f1f238daf6..6dc7d5a9cda 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -431,6 +431,20 @@ static void buttons_navigation_bar_region_draw(const bContext *C, ARegion *ar) ED_region_panels_draw(C, ar); } +static void buttons_navigation_bar_region_listener( + wmWindow *UNUSED(win), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn, + const Scene *UNUSED(scene)) +{ + /* Context changes. */ + switch (wmn->category) { + case NC_SCREEN: + if (ELEM(wmn->data, ND_LAYER)) { + ED_region_tag_redraw(ar); + } + break; + } +} + /* draw a certain button set only if properties area is currently * showing that button set, to reduce unnecessary drawing. */ static void buttons_area_redraw(ScrArea *sa, short buttons) @@ -732,6 +746,7 @@ void ED_spacetype_buttons(void) art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES; art->init = buttons_navigation_bar_region_init; art->draw = buttons_navigation_bar_region_draw; + art->listener = buttons_navigation_bar_region_listener; BLI_addhead(&st->regiontypes, art); BKE_spacetype_register(st); |