inspector: display dropdown and checkbox for boolean properties with extra choices

This commit is contained in:
bordun 2021-05-06 21:26:23 +02:00
parent a3c3c640fa
commit 3eba3f636a
2 changed files with 9 additions and 2 deletions

View file

@ -14,6 +14,9 @@
- button: add `soft` mode for the `wrap` property
- switch: add `wrap` property
- editor
- display dropdown and checkbox for boolean properties with extra choices
## 1.9.5
- bug fixes

View file

@ -88,7 +88,9 @@ class UiInspectorField extends UiWidget {
this.container.appendChild(wrapper)
} else if (this.default.type.includes('boolean')) {
}
if (this.default.type.includes('boolean')) {
let toggle = html`
<osc-inspector-checkbox name="${this.name}" class="${this.widget.getProp(this.name) ? 'on' : ''}">
@ -98,7 +100,9 @@ class UiInspectorField extends UiWidget {
this.container.appendChild(toggle)
} else if (this.name.includes('color')) {
}
if (this.name.includes('color')) {
let style = window.getComputedStyle(this.widget.container),
colorData = this.widget.constructor.cssVariables.find(x=>x.js === this.name),