From 369f350e0205a36a9dff5b6ee16a5d8112e862c6 Mon Sep 17 00:00:00 2001 From: doc-code Date: Fri, 13 Sep 2024 22:49:23 +0200 Subject: [PATCH] Add auto_init and only_with_multiple_scenes preferences --- addon/sw/funcs.py | 2 +- addon/sw/prefs.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addon/sw/funcs.py b/addon/sw/funcs.py index 32e5f6d..187d9e4 100644 --- a/addon/sw/funcs.py +++ b/addon/sw/funcs.py @@ -38,7 +38,7 @@ def get_use_topbar(): return prefs().use_topbar def get_only_with_multiple(): - return prefs().only_with_multiple_scene + return prefs().only_with_multiple_scenes def get_switch(): return prefs().switch diff --git a/addon/sw/prefs.py b/addon/sw/prefs.py index f21cba7..cabdee0 100644 --- a/addon/sw/prefs.py +++ b/addon/sw/prefs.py @@ -6,15 +6,22 @@ from bpy.props import BoolProperty class SW_Preferences(AddonPreferences): bl_idname = base_package + only_with_multiple_scenes: BoolProperty(name="Show only with multiple scenes", description="Show the topbar (and eventually the checkbox) only when the project has multiple scenes", default=False) + auto_init: BoolProperty(name="Auto initialize Scene Workspaces", description="Automatically add all avaliable workspaces to the current scene, if empty (with ordering only for common cases)", default=True) use_topbar: BoolProperty(name="Use Scene Workspaces topbar", description="Switch the workspace topbar between Scene Workspaces and the default one", default=True) - switch: BoolProperty(name="Show Switch", description="Show/Hide the switch button next to the workspaces topbar. Useful for quickly lookup the original workspaces topbar", default=True) + switch: BoolProperty(name="Show Checkbox", description="Show/Hide the checkbox button next to the workspaces topbar. Useful for quickly lookup the original workspaces topbar", default=True) compact: BoolProperty(name="Use Compact Mode", description="If disabled, adds spacing around the active workspace and a quick unlink button", default=True) def draw(self, context): layout = self.layout - layout.prop(self, "use_topbar") - layout.prop(self, "switch") + layout.prop(self, "only_with_multiple_scenes") + layout.prop(self, "auto_init") + if self.auto_init: + layout.label(text="Note: Scene Workspaces cannot retrive the global workspaces order.") + layout.label(text="Only workspaces from one of the 5 default templates will be automatically ordered.") box = layout.box() box.label(text="UI Options") + box.prop(self, "use_topbar") + box.prop(self, "switch") box.prop(self, "compact")