diff options
author | Ryan Inch <mythologylover75@gmail.com> | 2020-04-25 11:19:33 +0300 |
---|---|---|
committer | Ryan Inch <mythologylover75@gmail.com> | 2020-04-25 11:32:07 +0300 |
commit | 52435a23becb5d566356037343934d1aad99a32a (patch) | |
tree | d6c7ec7817bb3971a456c676ea5d63e1ecaefd38 /object_collection_manager/ui.py | |
parent | fa71f709da9cdeccde8b22f228886069d828f6c6 (diff) |
Collection Manager: Fix selection issues. Task: T69577
Make treeview selection more stable and predictable.
Fix not being able to select the row from the left side with
a top level expander -- adjusts window sizing to account for this.
Diffstat (limited to 'object_collection_manager/ui.py')
-rw-r--r-- | object_collection_manager/ui.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py index f4f0e73e..46d27e77 100644 --- a/object_collection_manager/ui.py +++ b/object_collection_manager/ui.py @@ -322,15 +322,6 @@ class CollectionManager(Operator): self.view_layer = view_layer.name - # sync selection in ui list with active layer collection - try: - active_laycol_name = view_layer.active_layer_collection.name - active_laycol_row_index = layer_collections[active_laycol_name]["row_index"] - cm.cm_list_index = active_laycol_row_index - - except KeyError: # Master Collection is special and not part of regular collections - cm.cm_list_index = -1 - # check if expanded & history/buffer state still correct if collection_state: new_state = generate_state() @@ -387,11 +378,12 @@ class CollectionManager(Operator): # handle window sizing max_width = 960 min_width = 456 + row_indent_width = 15 width_step = 21 scrollbar_width = 21 lvl = get_max_lvl() - width = min_width + (width_step * lvl) + width = min_width + row_indent_width + (width_step * lvl) if len(layer_collections) > 14: width += scrollbar_width @@ -440,6 +432,9 @@ class CM_UL_items(UIList): row = split.row(align=True) row.alignment = 'LEFT' + # allow room to select the row from the beginning + row.separator() + # indent child items if laycol["lvl"] > 0: for _ in range(laycol["lvl"]): |