diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-15 21:13:03 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-15 21:47:09 +0300 |
commit | 452a1c7b38383fd3f51532c429912677864e4a33 (patch) | |
tree | 37481ed6eca5cc6840dee0686b24b75ba1842cbc /release | |
parent | f137022f9919f4dd315ec6b325a08e1bf5aec6fb (diff) |
Collections: Add color tagging
This adds color tagging to collections. There are 8 color
options which are themable in the user preferences, with an additional
option for no color tag by default.
This adds a new filled collection icon and 8 colored variants of the
icon that can be themed in the user preferences.
In this commit the only interface to setting the color tags is through
Python, and there is nowhere in the interface where the collections are
shown colored. Setting and viewing the color tags from the outliner will
follow.
Manifest Task: https://developer.blender.org/T77777
Differential Revision: https://developer.blender.org/D8622
Diffstat (limited to 'release')
-rw-r--r-- | release/datafiles/blender_icons16/icon16_outliner_collection.dat | bin | 0 -> 1048 bytes | |||
-rw-r--r-- | release/datafiles/blender_icons32/icon32_outliner_collection.dat | bin | 0 -> 4120 bytes | |||
-rw-r--r-- | release/datafiles/userdef/userdef_default_theme.c | 26 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 19 |
4 files changed, 45 insertions, 0 deletions
diff --git a/release/datafiles/blender_icons16/icon16_outliner_collection.dat b/release/datafiles/blender_icons16/icon16_outliner_collection.dat Binary files differnew file mode 100644 index 00000000000..c46a6ce6f66 --- /dev/null +++ b/release/datafiles/blender_icons16/icon16_outliner_collection.dat diff --git a/release/datafiles/blender_icons32/icon32_outliner_collection.dat b/release/datafiles/blender_icons32/icon32_outliner_collection.dat Binary files differnew file mode 100644 index 00000000000..0fdd735553e --- /dev/null +++ b/release/datafiles/blender_icons32/icon32_outliner_collection.dat diff --git a/release/datafiles/userdef/userdef_default_theme.c b/release/datafiles/userdef/userdef_default_theme.c index 791630a1a9c..8cbb615491d 100644 --- a/release/datafiles/userdef/userdef_default_theme.c +++ b/release/datafiles/userdef/userdef_default_theme.c @@ -1103,6 +1103,32 @@ const bTheme U_theme_default = { .active = RGBA(0x000000ff), }, }, + .collection_color = { + { + .color = RGBA(0xe4312bff), + }, + { + .color = RGBA(0xef7e42ff), + }, + { + .color = RGBA(0xe4dd52ff), + }, + { + .color = RGBA(0x9ac546ff), + }, + { + .color = RGBA(0x46bcc2ff), + }, + { + .color = RGBA(0x8b65dcff), + }, + { + .color = RGBA(0x999999ff), + }, + { + .color = RGBA(0x06d4432ff), + }, + }, }; /* clang-format on */ diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index faea806c6cb..40cb03acdfc 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1019,6 +1019,24 @@ class USERPREF_PT_theme_bone_color_sets(ThemePanel, CenterAlignMixIn, Panel): flow.prop(ui, "active") flow.prop(ui, "show_colored_constraints") +class USERPREF_PT_theme_collection_colors(ThemePanel, CenterAlignMixIn, Panel): + bl_label = "Collection Colors" + bl_options = {'DEFAULT_CLOSED'} + + def draw_header(self, _context): + layout = self.layout + + layout.label(icon='OUTLINER_COLLECTION') + + def draw_centered(self, context, layout): + theme = context.preferences.themes[0] + + layout.use_property_split = True + + flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False) + for i, ui in enumerate(theme.collection_color, 1): + flow.prop(ui, "color", text=iface_(f"Color {i:d}"), translate=False) + # Base class for dynamically defined theme-space panels. # This is not registered. @@ -2256,6 +2274,7 @@ classes = ( USERPREF_PT_theme_interface_icons, USERPREF_PT_theme_text_style, USERPREF_PT_theme_bone_color_sets, + USERPREF_PT_theme_collection_colors, USERPREF_PT_file_paths_data, USERPREF_PT_file_paths_render, |