diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-12 10:38:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-12 10:39:41 +0300 |
commit | 963da9ff6e1c87bf340b5832f0c1ba2c28cbb338 (patch) | |
tree | a8799418ca14ed2212a49636c8099145fab84fcf /source | |
parent | 66087fe127b89390233dde4aee3c61d05a29c36b (diff) |
UI: 4-state icon for view visibility popover
This is a quick way to see if some of the object types in the
scene are hidden or unselected.
Icon design may change.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/datafiles/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/include/UI_icons.h | 10 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 15 |
3 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 640239ccc60..0e09ef6f583 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -435,6 +435,10 @@ set(ICON_NAMES copydown pasteflipup pasteflipdown + vis_sel_11 + vis_sel_10 + vis_sel_10 + vis_sel_00 snap_surface automerge_on automerge_off diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index a63855439f4..ec4c7dddd4c 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -728,12 +728,10 @@ DEF_ICON(PASTEDOWN) DEF_ICON(COPYDOWN) DEF_ICON(PASTEFLIPUP) DEF_ICON(PASTEFLIPDOWN) -#ifndef DEF_ICON_BLANK_SKIP - DEF_ICON(BLANK227) - DEF_ICON(BLANK228) - DEF_ICON(BLANK229) - DEF_ICON(BLANK230) -#endif +DEF_ICON(VIS_SEL_11) +DEF_ICON(VIS_SEL_10) +DEF_ICON(VIS_SEL_01) +DEF_ICON(VIS_SEL_00) DEF_ICON(SNAP_SURFACE) DEF_ICON(AUTOMERGE_ON) DEF_ICON(AUTOMERGE_OFF) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index c3378a68884..b98ec3b0204 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -905,6 +905,15 @@ static const EnumPropertyItem *rna_SpaceView3D_stereo3d_camera_itemf( return stereo3d_camera_items; } +static int rna_SpaceView3D_icon_from_show_object_viewport_get(PointerRNA *ptr) +{ + const View3D *v3d = (View3D *)ptr->data; + /* Ignore selection values when view is off, intent is to show if visible objects aren't selectable. */ + const int view_value = (v3d->object_type_exclude_viewport != 0); + const int select_value = (v3d->object_type_exclude_select & ~v3d->object_type_exclude_viewport) != 0; + return ICON_VIS_SEL_11 + (view_value << 1) + select_value; +} + static PointerRNA rna_SpaceView3D_shading_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_View3DShading, ptr->data); @@ -3113,6 +3122,12 @@ static void rna_def_space_view3d(BlenderRNA *brna) } } + + /* Heper for drawing the icon. */ + prop = RNA_def_property(srna, "icon_from_show_object_viewport", PROP_INT, PROP_NONE); + RNA_def_property_int_funcs(prop, "rna_SpaceView3D_icon_from_show_object_viewport_get", NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Visibility Iconm", ""); } /* Nested Structs */ |