diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-05-20 13:14:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-20 14:47:37 +0300 |
commit | 785ff8e1d2e973e10c1a3aea3a986c7e1d3cf1db (patch) | |
tree | 086ac1ae7f7fcf8b49f12d6d904cb2590a1c00b6 /source/blender/editors/interface | |
parent | 81320ce7f7c699d832edf8ba0f609bb246389a33 (diff) |
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
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface.c | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index f1724d92402..e436328c139 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1845,6 +1845,9 @@ int ui_but_is_pushed_ex(uiBut *but, double *value) } } + if ((but->drawflag & UI_BUT_CHECKBOX_INVERT) && (is_push != -1)) { + is_push = !((bool)is_push); + } return is_push; } int ui_but_is_pushed(uiBut *but) 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; } |