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/scripts/startup/bl_ui | |
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/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 19 |
1 files changed, 19 insertions, 0 deletions
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, |