Module for registering and managing project settings panels in Lens Studio.
// ProjectSettingsPlugin adds custom settings panels to the Lens Studio// Project Settings dialog.//// Descriptor fields:// icon: Editor.Icon — icon for the settings entry// section: string — section name for grouping//// Plugin methods:// createWidget(parent): Widget — build the settings UI// deinit(): void — clean up resources// setIssues(issues): void — report errors/warnings for the panelexport class ProjectSettingsPluginExampleSettings extends ProjectSettingsPlugin { connections: any[]; root: Widget | null; static descriptor() { const d = new Descriptor(); d.id = 'com.docs.ProjectSettingsPluginExample'; d.name = 'Example Settings'; d.description = 'Demonstrates a minimal ProjectSettingsPlugin'; d.section = 'Examples'; return d; } constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) { super(pluginSystem, descriptor); this.connections = []; this.root = null; } createWidget(parent: Widget): Widget { this.root = new Widget(parent); const layout = new BoxLayout(); layout.setDirection(Direction.TopToBottom); layout.spacing = 8; this.root.layout = layout; const title = new Label(this.root); title.text = 'Example Project Settings'; layout.addWidget(title); const btn = new PushButton(this.root); btn.text = 'Check Status'; this.connections.push(btn.onClick.connect(() => { console.log('Settings panel check complete'); })); layout.addWidget(btn); return this.root; } deinit(): void { this.connections.forEach((c: any) => c?.disconnect()); this.connections = []; if (this.root) { this.root.deleteLater(); this.root = null; } }} Copy
// ProjectSettingsPlugin adds custom settings panels to the Lens Studio// Project Settings dialog.//// Descriptor fields:// icon: Editor.Icon — icon for the settings entry// section: string — section name for grouping//// Plugin methods:// createWidget(parent): Widget — build the settings UI// deinit(): void — clean up resources// setIssues(issues): void — report errors/warnings for the panelexport class ProjectSettingsPluginExampleSettings extends ProjectSettingsPlugin { connections: any[]; root: Widget | null; static descriptor() { const d = new Descriptor(); d.id = 'com.docs.ProjectSettingsPluginExample'; d.name = 'Example Settings'; d.description = 'Demonstrates a minimal ProjectSettingsPlugin'; d.section = 'Examples'; return d; } constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) { super(pluginSystem, descriptor); this.connections = []; this.root = null; } createWidget(parent: Widget): Widget { this.root = new Widget(parent); const layout = new BoxLayout(); layout.setDirection(Direction.TopToBottom); layout.spacing = 8; this.root.layout = layout; const title = new Label(this.root); title.text = 'Example Project Settings'; layout.addWidget(title); const btn = new PushButton(this.root); btn.text = 'Check Status'; this.connections.push(btn.onClick.connect(() => { console.log('Settings panel check complete'); })); layout.addWidget(btn); return this.root; } deinit(): void { this.connections.forEach((c: any) => c?.disconnect()); this.connections = []; if (this.root) { this.root.deleteLater(); this.root = null; } }}
Module for registering and managing project settings panels in Lens Studio.
Example