diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-11-15 18:32:03 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-11-15 21:59:42 +0300 |
commit | f8964809b82e679d58669342ee0035db01a6c0c9 (patch) | |
tree | da96affd922579dff8bcdb46e1d40b162f10f5d3 /source/blender/editors/object/object_edit.c | |
parent | 0ff424b299264f9db09f513e394322137c317a4e (diff) |
Viewport collections visibility: Viewport and Selection options
Right now we have a different behaviour whether users click on the name or on
the visibility eye.
When clicking on the eye, it is a toggle. When clicking in the name, you
are isolating this collection (unless you use shift).
As for the UI I tried using separator_spacer, but it was more work than
worth. A lot of sub panels, and LEFT/RIGHT alignment work just fine.
Diffstat (limited to 'source/blender/editors/object/object_edit.c')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 2e8ae8f2cc2..e9bea64b56c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -275,10 +275,13 @@ void OBJECT_OT_hide_view_set(wmOperatorType *ot) static int object_hide_collection_exec(bContext *C, wmOperator *op) { + wmWindow *win = CTX_wm_window(C); + int index = RNA_int_get(op->ptr, "collection_index"); - bool extend = (CTX_wm_window(C)->eventstate->shift != 0); + const bool extend = (win->eventstate->shift != 0) || + RNA_boolean_get(op->ptr, "toggle"); - if (CTX_wm_window(C)->eventstate->alt != 0) { + if (win->eventstate->alt != 0) { index += 10; } @@ -382,6 +385,8 @@ void OBJECT_OT_hide_collection(wmOperatorType *ot) prop = RNA_def_int(ot->srna, "collection_index", COLLECTION_INVALID_INDEX, COLLECTION_INVALID_INDEX, INT_MAX, "Collection Index", "Index of the collection to change visibility", 0, INT_MAX); RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); + prop = RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", "Toggle visibility"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); } /* ******************* toggle editmode operator ***************** */ |