diff options
Diffstat (limited to 'object_collection_manager/ui.py')
-rw-r--r-- | object_collection_manager/ui.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py index 61c44a5b..f4f0e73e 100644 --- a/object_collection_manager/ui.py +++ b/object_collection_manager/ui.py @@ -150,7 +150,7 @@ class CollectionManager(Operator): prop = master_collection_row.operator("view3d.set_active_collection", text='', icon='GROUP', depress=highlight) - prop.collection_index = 0 + prop.collection_index = -1 prop.collection_name = 'Master Collection' master_collection_row.separator() @@ -471,7 +471,17 @@ class CM_UL_items(UIList): row.label(icon='BLANK1') - row.label(icon='GROUP') + # collection icon + c_icon = row.row() + highlight = False + if (context.view_layer.active_layer_collection == laycol["ptr"]): + highlight = True + + prop = c_icon.operator("view3d.set_active_collection", text='', icon='GROUP', + emboss=highlight, depress=highlight) + + prop.collection_index = laycol["row_index"] + prop.collection_name = item.name if context.preferences.addons[__package__].preferences.enable_qcd: QCD = row.row() @@ -792,18 +802,6 @@ def update_icon(base, icon, theme_color): icon.icon_pixels_float = colored_icon -def update_selection(self, context): - cm = context.scene.collection_manager - - if cm.cm_list_index == -1: - return - - selected_item = cm.cm_list_collection[cm.cm_list_index] - layer_collection = layer_collections[selected_item.name]["ptr"] - - context.view_layer.active_layer_collection = layer_collection - - def filter_items_by_name_insensitive(pattern, bitflag, items, propname="name", flags=None, reverse=False): """ Set FILTER_ITEM for items which name matches filter_name one (case-insensitive). |