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-01-09 09:15:22 +0300
committerRyan Inch <mythologylover75@gmail.com>2020-01-09 09:15:22 +0300
commite7a8ab248112edffe09b574b68352160b59021db (patch)
treee9c503992c54f58c844cd472d145f98817b752db /object_collection_manager
parent4e3539fa890a0f4f43269751b28476122c8b9f6d (diff)
Collection Manager: Improve width calculation. Task: T69577
Improves the width calculation for the main window to better accommodate sub-collections and take into account the width of the scroll bar when it's present.
Diffstat (limited to 'object_collection_manager')
-rw-r--r--object_collection_manager/__init__.py2
-rw-r--r--object_collection_manager/ui.py33
2 files changed, 18 insertions, 17 deletions
diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index 4d19a5da..16917fff 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": (1,8,7),
+ "version": (1,8,8),
"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/ui.py b/object_collection_manager/ui.py
index 604f105d..dfdeb889 100644
--- a/object_collection_manager/ui.py
+++ b/object_collection_manager/ui.py
@@ -152,23 +152,8 @@ class CollectionManager(Operator):
def execute(self, context):
wm = context.window_manager
- lvl = 0
-
- #expanded.clear()
-
- #excludeall_history.clear()
- #restrictselectall_history.clear()
- #hideall_history.clear()
- #disableviewall_history.clear()
- #disablerenderall_history.clear()
update_property_group(context)
-
- lvl = get_max_lvl()
-
- if lvl > 25:
- lvl = 25
-
self.view_layer = context.view_layer.name
# sync selection in ui list with active layer collection
@@ -179,6 +164,7 @@ class CollectionManager(Operator):
except:
context.scene.CMListIndex = -1
+ # check if in phantom mode and if it's still viable
if context.scene.CM_Phantom_Mode:
if set(layer_collections.keys()) != set(phantom_history["initial_state"].keys()):
context.scene.CM_Phantom_Mode = False
@@ -186,7 +172,22 @@ class CollectionManager(Operator):
if context.view_layer.name != phantom_history["view_layer"]:
context.scene.CM_Phantom_Mode = False
- return wm.invoke_popup(self, width=(400+(lvl*20)))
+ # handle window sizing
+ max_width = 960
+ min_width = 456
+ width_step = 21
+ scrollbar_width = 21
+ lvl = get_max_lvl()
+
+ width = min_width + (width_step * lvl)
+
+ if len(layer_collections) > 14:
+ width += scrollbar_width
+
+ if width > max_width:
+ width = max_width
+
+ return wm.invoke_popup(self, width=width)
def update_selection(self, context):