From 785ff8e1d2e973e10c1a3aea3a986c7e1d3cf1db Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 20 May 2019 12:14:48 +0200 Subject: UI: add Visibility panel for objects The outliner should not be the only way for users to change these settings. The Python API was extended to keep these properties positive and keyframable. Differential Revision: https://developer.blender.org/D4889 --- source/blender/editors/interface/interface_layout.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/editors/interface/interface_layout.c') diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index dc57be4f07f..df4b18477fc 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1904,6 +1904,10 @@ void uiItemFullR(uiLayout *layout, } } + if (type != PROP_BOOLEAN) { + flag &= ~UI_ITEM_R_CHECKBOX_INVERT; + } + if (icon == ICON_NONE) { icon = RNA_property_ui_icon(prop); } @@ -2156,6 +2160,12 @@ void uiItemFullR(uiLayout *layout, but->type = UI_BTYPE_NUM_SLIDER; } + if (flag & UI_ITEM_R_CHECKBOX_INVERT) { + if (ELEM(but->type, UI_BTYPE_CHECKBOX, UI_BTYPE_CHECKBOX_N)) { + but->drawflag |= UI_BUT_CHECKBOX_INVERT; + } + } + if (toggle && but->type == UI_BTYPE_CHECKBOX) { but->type = UI_BTYPE_TOGGLE; } -- cgit v1.2.3