diff options
author | Julian Eisel <julian@linux-chl2.site> | 2015-04-08 01:28:03 +0300 |
---|---|---|
committer | Julian Eisel <julian@linux-chl2.site> | 2015-04-08 01:41:37 +0300 |
commit | 7e52d810f3a1b6ba8732eb7ccab11ecf9cfbb09f (patch) | |
tree | abc1667282d6c77b5a310869ebbe15c91844193e /source | |
parent | 796c3c774820edf70572a6717ceb6c188a267577 (diff) |
Muliview: Minor UI-tweaks
* Don't grey multiview options in file browser and in Node Editor Properties out if multi-view is disabled, hide them completely (I think greying out single buttons is fine, but in case of entire blocks we should just hide to save space)
* Move multiview settings in Node Editor Properties above alpha settings to prevent the alpha buttons from appearing above multiview settings if multiview is enabled and Stereo 3D format is chosen (making them appear below is much nicer)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index a02f64d68d8..ee298a27b25 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -896,6 +896,14 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char BKE_image_release_ibuf(ima, ibuf, NULL); } + if ((scene->r.scemode & R_MULTIVIEW) != 0) { + uiItemR(layout, &imaptr, "use_multiview", 0, NULL, ICON_NONE); + + if (RNA_boolean_get(&imaptr, "use_multiview")) { + uiTemplateImageViews(layout, &imaptr); + } + } + if (has_alpha) { col = uiLayoutColumn(layout, false); uiItemR(col, &imaptr, "use_alpha", 0, NULL, ICON_NONE); @@ -904,24 +912,11 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char uiItemR(row, &imaptr, "alpha_mode", 0, IFACE_("Alpha"), ICON_NONE); } - if ((scene->r.scemode & R_MULTIVIEW) != 0) { - uiItemS(layout); - - col = uiLayoutColumn(layout, false); - uiItemR(col, &imaptr, "use_multiview", 0, NULL, ICON_NONE); - - col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(&imaptr, "use_multiview")); - uiTemplateImageViews(col, &imaptr); - } - if (ima->source == IMA_SRC_MOVIE) { col = uiLayoutColumn(layout, false); uiItemR(col, &imaptr, "use_deinterlace", 0, IFACE_("Deinterlace"), ICON_NONE); } - uiItemS(layout); - split = uiLayoutSplit(layout, 0.0f, false); col = uiLayoutColumn(split, false); @@ -1155,28 +1150,25 @@ void uiTemplateImageViews(uiLayout *layout, PointerRNA *imaptr) void uiTemplateImageFormatViews(uiLayout *layout, PointerRNA *imfptr, PointerRNA *ptr) { ImageFormatData *imf = imfptr->data; - uiLayout *col; - if (ptr) { - uiItemR(layout, ptr, "use_multiview", 0, NULL, ICON_NONE); - col = uiLayoutColumn(layout, false); - uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_multiview")); - } - else { - col = uiLayoutColumn(layout, false); - } + if (ptr == NULL) + return; - if (imf->imtype != R_IMF_IMTYPE_MULTILAYER) { - PropertyRNA *prop; - PointerRNA stereo3d_format_ptr; + uiItemR(layout, ptr, "use_multiview", 0, NULL, ICON_NONE); - prop = RNA_struct_find_property(imfptr, "stereo_3d_format"); - stereo3d_format_ptr = RNA_property_pointer_get(imfptr, prop); + if (RNA_boolean_get(ptr, "use_multiview")) { + if (imf->imtype != R_IMF_IMTYPE_MULTILAYER) { + PropertyRNA *prop; + PointerRNA stereo3d_format_ptr; - uiTemplateViewsFormat(col, imfptr, &stereo3d_format_ptr); - } - else { - uiTemplateViewsFormat(col, imfptr, NULL); + prop = RNA_struct_find_property(imfptr, "stereo_3d_format"); + stereo3d_format_ptr = RNA_property_pointer_get(imfptr, prop); + + uiTemplateViewsFormat(layout, imfptr, &stereo3d_format_ptr); + } + else { + uiTemplateViewsFormat(layout, imfptr, NULL); + } } } |