diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-02-13 21:49:26 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-02-19 19:22:01 +0400 |
commit | eb7485389b8ae29c0f56c942e800722fe25ebebe (patch) | |
tree | 0c4f71c85a75647f1a7d1ca084a1cd4295f88288 /source/blender/editors/space_image/image_buttons.c | |
parent | 6b1a4fc66ef4e3197601318ce4c36db2c8359b98 (diff) |
Use tabs for image editor.
For initial discussion see T38371
This commit organized panels for image editor to new tab categories dependent
on the image editor mode:
View Mode:
Tools - contains UV tools (currently only transform and UV Sculpting)
Scopes - contains scopes
Grease Pencil - contains Grease Pencil operators
Paint Mode:
Tools - contains brush options
Scopes - as above
Grease Pencil - as above
Mask Mode
Mask - contains mask tools
Scopes - as above
Grease Pencil - as above
Grease Pencil panel/tab now includes operators, not view options which have been
moved to the UI region on the right.
To make this work better, image editor toolbar now is of type TOOLS instead
of PREVIEW as was the case previously. A nice version patch makes sure all
works predictably, but opening newer files with older blender executables
could backfire.
This commit does not address which UV Tools will be included in the
Tools tab for the view mode, but does include some basic tools (transform)
and provides a class to inherit from to avoid conflicts with UV Sculpting.
Reviewers: brecht, dingto, sergey
Differential Revision: https://developer.blender.org/D315
Diffstat (limited to 'source/blender/editors/space_image/image_buttons.c')
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 6b0f4a0615c..21f54a86df4 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -948,6 +948,7 @@ void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser void image_buttons_register(ARegionType *art) { PanelType *pt; + const char *category = "Grease Pencil"; pt = MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil"); strcpy(pt->idname, "IMAGE_PT_gpencil"); @@ -955,6 +956,7 @@ void image_buttons_register(ARegionType *art) strcpy(pt->translation_context, BLF_I18NCONTEXT_DEFAULT_BPYRNA); pt->draw_header = gpencil_panel_standard_header; pt->draw = gpencil_panel_standard; + BLI_strncpy(pt->category, category, BLI_strlen_utf8(category)); BLI_addtail(&art->paneltypes, pt); } @@ -985,7 +987,7 @@ void IMAGE_OT_properties(wmOperatorType *ot) static int image_scopes_toggle_exec(bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa = CTX_wm_area(C); - ARegion *ar = image_has_scope_region(sa); + ARegion *ar = image_has_tools_region(sa); if (ar) ED_region_toggle_hidden(C, ar); @@ -993,12 +995,12 @@ static int image_scopes_toggle_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -void IMAGE_OT_scopes(wmOperatorType *ot) +void IMAGE_OT_toolshelf(wmOperatorType *ot) { - ot->name = "Scopes"; - ot->idname = "IMAGE_OT_scopes"; - ot->description = "Toggle display scopes panel"; - + ot->name = "Tool Shelf"; + ot->idname = "IMAGE_OT_toolshelf"; + ot->description = "Toggles tool shelf display"; + ot->exec = image_scopes_toggle_exec; ot->poll = ED_operator_image_active; |