diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index 4d19a5dae58367a26b3ae5d9df4b76c8b1db2660..16917ffffe59c0d967d596c4f8d512b4bbf179b0 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 604f105d3d6feb37f6418b7b6f11ffc993cf77f4..dfdeb889c8babdb4f40dc34c3c3453e479f9bc66 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):