From 84e5c981dc8915caa75b60d101d94ed7ac0a0670 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 May 2018 22:07:07 +0200 Subject: UI: toolbars now redraw on tool change --- source/blender/editors/space_image/space_image.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/editors/space_image') diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index c303a78594d..586f27eb462 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -72,6 +72,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "WM_message.h" #include "UI_resources.h" #include "UI_interface.h" @@ -979,6 +980,21 @@ static void image_tools_region_listener( } } +static void image_tools_region_message_subscribe( + const struct bContext *UNUSED(C), + struct WorkSpace *UNUSED(workspace), struct Scene *UNUSED(scene), + struct bScreen *UNUSED(screen), struct ScrArea *UNUSED(sa), struct ARegion *ar, + struct wmMsgBus *mbus) +{ + wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { + .owner = ar, + .user_data = ar, + .notify = ED_region_do_msg_notify_tag_redraw, + }; + WM_msg_subscribe_rna_anon_prop(mbus, WorkSpace, tools, &msg_sub_value_region_tag_redraw); +} + + /************************* header region **************************/ /* add handlers, stuff you only do once or on area/region changes */ @@ -1100,6 +1116,7 @@ void ED_spacetype_image(void) art->prefsizex = 220; // XXX art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES; art->listener = image_tools_region_listener; + art->message_subscribe = image_tools_region_message_subscribe; art->init = image_tools_region_init; art->draw = image_tools_region_draw; BLI_addhead(&st->regiontypes, art); -- cgit v1.2.3