diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-04 01:54:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-04 02:37:22 +0300 |
commit | 3c8c1841d72d8b9b13799c9a12cd8637b38be51d (patch) | |
tree | 08c0a06d79ab98d5a878051246645931d6eb6faf /source/blender/editors/space_image/space_image.c | |
parent | 55f62b94f861b3284ae813fd4d0ca9f1458f7ae5 (diff) |
UI: use shared toolbar region callbacks
Image toolbar now starts with a single column width
and snaps to button increments.
Diffstat (limited to 'source/blender/editors/space_image/space_image.c')
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index acf928fc1a5..60431adad0e 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -977,21 +977,6 @@ 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 */ @@ -1109,10 +1094,12 @@ void ED_spacetype_image(void) /* regions: statistics/scope buttons */ art = MEM_callocN(sizeof(ARegionType), "spacetype image region"); art->regionid = RGN_TYPE_TOOLS; - art->prefsizex = 220; // XXX + art->prefsizex = 58; /* XXX */ + art->prefsizey = 50; /* XXX */ art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES; art->listener = image_tools_region_listener; - art->message_subscribe = image_tools_region_message_subscribe; + art->message_subscribe = ED_region_generic_tools_region_message_subscribe; + art->snap_size = ED_region_generic_tools_region_snap_size; art->init = image_tools_region_init; art->draw = image_tools_region_draw; BLI_addhead(&st->regiontypes, art); |