Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Inch <mythologylover75@gmail.com>2020-05-24 10:48:23 +0300
committerRyan Inch <mythologylover75@gmail.com>2020-05-24 10:57:43 +0300
commitb04d72273203b8517a111908985ea37fbb60c76f (patch)
treebc743e47bb9044e9eb08fa16d2dc10c6826f8cfd /object_collection_manager
parent115df62ee4fa9bbbe4ac8d052a3525df4caaa181 (diff)
Collection Manager: Fix scrolling issue. Task: T69577
Set the selection to the collection when clicking on its expander. This prevents the tree view scrolling changing when expanding/collapsing subcollections. This also sets the selection to the first collection when collapsing all collections to prevent loosing the selected row and then later adding collections to some unknown region.
Diffstat (limited to 'object_collection_manager')
-rw-r--r--object_collection_manager/__init__.py2
-rw-r--r--object_collection_manager/operators.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index 60dae31f..c2da282f 100644
--- a/object_collection_manager/__init__.py
+++ b/object_collection_manager/__init__.py
@@ -22,7 +22,7 @@ bl_info = {
"name": "Collection Manager",
"description": "Manage collections and their objects",
"author": "Ryan Inch",
- "version": (2, 7, 24),
+ "version": (2, 7, 25),
"blender": (2, 80, 0),
"location": "View3D - Object Mode (Shortcut - M)",
"warning": '', # used for warning icon and text in addons panel
diff --git a/object_collection_manager/operators.py b/object_collection_manager/operators.py
index 4d028cf2..9958f96f 100644
--- a/object_collection_manager/operators.py
+++ b/object_collection_manager/operators.py
@@ -105,6 +105,7 @@ class ExpandAllOperator(Operator):
if len(expanded) > 0:
expanded.clear()
+ context.scene.collection_manager.cm_list_index = 0
else:
for laycol in layer_collections.values():
if laycol["ptr"].children:
@@ -204,6 +205,9 @@ class ExpandSublevelOperator(Operator):
expand_history["target"] = ""
expand_history["history"].clear()
+ # set the selected row to the collection you're expanding/collapsing to
+ # preserve the tree view's scrolling
+ context.scene.collection_manager.cm_list_index = self.index
#update tree view
update_property_group(context)