From 452a1c7b38383fd3f51532c429912677864e4a33 Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Tue, 15 Sep 2020 12:13:03 -0600 Subject: 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 --- release/scripts/startup/bl_ui/space_userpref.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'release/scripts/startup') 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, -- cgit v1.2.3