Add auto_init and only_with_multiple_scenes preferences

This commit is contained in:
Francesco Bellini 2024-09-13 22:49:23 +02:00
parent 14fa397c1b
commit 369f350e02
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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")