From 553babd93cd00b53eaee7c7844c3c870dbb98ea3 Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 14 May 2020 23:19:55 +0200 Subject: [PATCH] inspector: regroup class-specific props under the same category dropdown --- src/client/ui/ui-inspector.js | 15 ++++++++++----- src/client/widgets/basics/button.js | 2 +- src/client/widgets/basics/dropdown.js | 2 +- src/client/widgets/basics/file.js | 2 +- src/client/widgets/basics/input.js | 2 +- src/client/widgets/basics/menu.js | 2 +- src/client/widgets/basics/switch.js | 2 +- src/client/widgets/common/widget.js | 6 +++--- src/client/widgets/containers/clone.js | 4 ++-- src/client/widgets/containers/keyboard.js | 2 +- src/client/widgets/containers/matrix.js | 4 ++-- src/client/widgets/containers/modal.js | 4 ++-- src/client/widgets/containers/panel.js | 6 +++--- src/client/widgets/containers/patchbay.js | 2 +- src/client/widgets/containers/root.js | 8 ++++---- src/client/widgets/containers/tab.js | 8 ++++---- src/client/widgets/frames/html.js | 2 +- src/client/widgets/frames/image.js | 2 +- src/client/widgets/frames/svg.js | 2 +- src/client/widgets/graphs/eq.js | 2 +- src/client/widgets/graphs/plot.js | 2 +- src/client/widgets/graphs/visualizer.js | 2 +- src/client/widgets/indicators/led.js | 2 +- src/client/widgets/indicators/text.js | 2 +- src/client/widgets/pads/canvas.js | 2 +- src/client/widgets/pads/multixy.js | 4 ++-- src/client/widgets/pads/rgb.js | 2 +- src/client/widgets/pads/xy.js | 2 +- src/client/widgets/scripts/gyro-archive.js | 2 +- src/client/widgets/scripts/script.js | 4 ++-- src/client/widgets/sliders/encoder.js | 2 +- src/client/widgets/sliders/fader.js | 2 +- src/client/widgets/sliders/knob.js | 2 +- src/scss/ui/inspector.scss | 22 ++++++++++++++++++++-- 34 files changed, 77 insertions(+), 54 deletions(-) diff --git a/src/client/ui/ui-inspector.js b/src/client/ui/ui-inspector.js index 3057f78e..a18d23d2 100644 --- a/src/client/ui/ui-inspector.js +++ b/src/client/ui/ui-inspector.js @@ -18,7 +18,7 @@ class UiInspector extends UiWidget { this.mounted = false - this.expandedCategories = ['widget'] + this.expandedCategories = ['_widget'] this.widget = null @@ -118,7 +118,7 @@ class UiInspector extends UiWidget { for (let propName in props) { - if (propName === '_children' || propName === 'tabs' || propName === 'widgets') continue + if (propName === '_children' || propName === 'tabs' || propName === 'widgets' || propName === '_props') continue let field, shared = true @@ -131,13 +131,18 @@ class UiInspector extends UiWidget { if (!shared) continue - if (propName.indexOf('_') === 0 && propName !== '_props') { + + if (propName.indexOf('_separator') > -1) { + + field = html`
${props[propName]}
` + + } else if (propName.indexOf('_') === 0) { if (category) content.appendChild(category) - category = html`` + category = html`` - field = html`
${props[propName]}${propName === '_widget' && widgets.length > 1 ? `s (${widgets.length})` : ''}
` + field = html`
${props[propName]}${propName === '_widget' && widgets.length > 1 ? `s (${widgets.length})` : ''}
` } else if (widget.props[propName] === undefined) { diff --git a/src/client/widgets/basics/button.js b/src/client/widgets/basics/button.js index 73567e42..77546625 100644 --- a/src/client/widgets/basics/button.js +++ b/src/client/widgets/basics/button.js @@ -17,7 +17,7 @@ class Button extends Widget { return super.defaults({ - _button: 'button', + _class_specific: 'button', label: {type: 'string|boolean', value: 'auto', help: [ 'Set to `false` to hide completely', diff --git a/src/client/widgets/basics/dropdown.js b/src/client/widgets/basics/dropdown.js index 33e3b2db..97f1f637 100644 --- a/src/client/widgets/basics/dropdown.js +++ b/src/client/widgets/basics/dropdown.js @@ -15,7 +15,7 @@ class Dropdown extends MenuBase { return super.defaults({ - _dropdown:'dropdown', + _class_specific: 'dropdown', align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'}, values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [ diff --git a/src/client/widgets/basics/file.js b/src/client/widgets/basics/file.js index de6ba609..b195711f 100644 --- a/src/client/widgets/basics/file.js +++ b/src/client/widgets/basics/file.js @@ -14,7 +14,7 @@ module.exports = class File extends Widget { return super.defaults({ - _input:'input', + _class_specific: 'input', align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'}, directory: {type: 'string', value: 'auto', help: 'Default browsing directory'}, diff --git a/src/client/widgets/basics/input.js b/src/client/widgets/basics/input.js index 85e8f738..16a9f45d 100644 --- a/src/client/widgets/basics/input.js +++ b/src/client/widgets/basics/input.js @@ -14,7 +14,7 @@ class Input extends Canvas { return super.defaults({ - _input:'input', + _class_specific: 'input', align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'}, unit: {type: 'string', value: '', help: 'Unit will be appended to the displayed widget\'s value (it doesn\'t affect osc messages)'}, diff --git a/src/client/widgets/basics/menu.js b/src/client/widgets/basics/menu.js index c7d1b150..46b5cdd6 100644 --- a/src/client/widgets/basics/menu.js +++ b/src/client/widgets/basics/menu.js @@ -16,7 +16,7 @@ class Menu extends MenuBase { return super.defaults({ - _menu:'menu', + _class_specific: 'menu', size: {type: 'number|array', value: 200, help: [ '- If `layout` is `circular`: diameter (in px)', diff --git a/src/client/widgets/basics/switch.js b/src/client/widgets/basics/switch.js index d7c994f6..2adf0153 100644 --- a/src/client/widgets/basics/switch.js +++ b/src/client/widgets/basics/switch.js @@ -15,7 +15,7 @@ class Switch extends MenuBase { return super.defaults({ - _switch:'switch', + _class_specific: 'switch', layout: {type: 'string', value: 'vertical', choices: ['vertical', 'horizontal', 'grid'], help:''}, gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'}, diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 8c47ca2d..eb2b4f94 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -47,14 +47,14 @@ class Widget extends EventEmitter { var defaults = { - _widget:'widget', + _widget: 'widget', type: {type: 'string', value: 'auto', help: 'Widget type'}, id: {type: 'string', value: 'auto', help: 'Widgets sharing the same `id` will act as clones and update each other\'s value(s) without sending extra osc messages.' }, visible: {type: 'boolean', value: true, help: 'Set to `false` to hide the widget.'}, interaction: {type: 'boolean', value: true, help: 'Set to `false` to disable pointer interactions.'}, - _geometry:'geometry', + _geometry: 'geometry', left: {type: 'number|string', value: 'auto', help: [ 'When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).', @@ -68,7 +68,7 @@ class Widget extends EventEmitter { height: {type: 'number|percentage', value: 'auto', help: 'Widget height'}, expand: {type: 'boolean|number', value: 'false', help: 'If parent\'s layout is `vertical` or `horizontal`, set this to `true` to stretch the widget to use available space automatically.'}, - _style:'style', + _style: 'style', colorBg: {type: 'string', value: 'auto', help: 'Panel background color. Set to "auto" to inherit from parent widget.'}, diff --git a/src/client/widgets/containers/clone.js b/src/client/widgets/containers/clone.js index f7dbe407..27d58a66 100644 --- a/src/client/widgets/containers/clone.js +++ b/src/client/widgets/containers/clone.js @@ -20,11 +20,11 @@ class Clone extends Container() { return super.defaults({ - _clone:'clone', + _class_specific: 'clone', widgetId: {type: 'string', value: '', help: '`id` of the widget to clone'}, - _overrides:'overrides', + _separator: 'overrides', props: {type: 'object', value: {}, help: 'Cloned widget\'s properties to override'}, diff --git a/src/client/widgets/containers/keyboard.js b/src/client/widgets/containers/keyboard.js index c0ec82a5..0c121446 100644 --- a/src/client/widgets/containers/keyboard.js +++ b/src/client/widgets/containers/keyboard.js @@ -15,7 +15,7 @@ module.exports = class Keyboard extends Panel { return Widget.defaults({ - _matrix: 'matrix', + _class_specific: 'matrix', keys: {type: 'number', value: 25, help: 'Defines the number keys'}, start: {type: 'number', value: 48, help: [ diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index 2023b394..58230a19 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -17,7 +17,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) { return Widget.defaults({ - _matrix: 'matrix: widgets', + _class_specific: 'matrix: widgets', widgetType: {type: 'string', value: 'button', help: 'Defines the type of the widgets in the matrix'}, quantity: {type: 'number', value: 4, help: 'Defines the number of widgets in the matrix'}, @@ -28,7 +28,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) { 'Note: by default, the widgets inherit from the matrix\' `id` and osc properties (`id` and `address` are appended with `/$`)' ]}, - _matrixLayout: 'matrix: layout', + _separator: 'layout', layout: {type: 'string', value: 'horizontal', choices: ['horizontal', 'vertical', 'grid'], help: 'Defines how children are laid out.'}, gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'}, diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index a64944d3..6baa40cb 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -18,7 +18,7 @@ class Modal extends Panel { return Widget.defaults({ - _modal: 'modal', + _class_specific: 'modal', label: {type: 'string|boolean', value: 'auto', help: [ 'Set to `false` to hide completely', @@ -28,7 +28,7 @@ class Modal extends Panel { doubleTap: {type: 'boolean', value: false, help: 'Set to `true` to make the modal require a double tap to open instead of a single tap'}, variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, - _modalWidgets: 'modal: popup', + _separator: 'popup', popupLabel: {type: 'string|boolean', value: 'auto', help: 'Alternative label for the modal popup'}, popupWidth: {type: 'number|percentage', value: '80%', help: 'Modal popup\'s size'}, diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index a320b7ec..550c5ebe 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -17,12 +17,12 @@ class Panel extends Container() { return super.defaults({ - _panel: 'panel', + _class_specific: 'panel', variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, - _panel_widgets: 'panel: widget container', + _separator1: 'widget container', layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'}, justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'}, @@ -30,7 +30,7 @@ class Panel extends Container() { scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, - _panel_tabs: 'panel: tab container', + _separator2: 'tab container', verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'}, diff --git a/src/client/widgets/containers/patchbay.js b/src/client/widgets/containers/patchbay.js index 841f54b1..12703ef6 100644 --- a/src/client/widgets/containers/patchbay.js +++ b/src/client/widgets/containers/patchbay.js @@ -73,7 +73,7 @@ class PatchBay extends Container(Canvas) { return super.defaults({ - _patchbay:'patchbay', + _class_specific: 'patchbay', inputs: {type: 'array|object', value: ['input_1', 'input_2'], help: [ '- `Array` of input names : `[\'input_1\', \'input_2\']`', diff --git a/src/client/widgets/containers/root.js b/src/client/widgets/containers/root.js index 76b14bc7..bddc65ab 100644 --- a/src/client/widgets/containers/root.js +++ b/src/client/widgets/containers/root.js @@ -14,12 +14,12 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro return Widget.defaults({ - _panel: 'panel', + _class_specific: 'panel', variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, - _panel_widgets: 'panel: widget container', + _separator1: 'widget container', layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'}, justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'}, @@ -27,7 +27,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, - _panel_tabs: 'panel: tab container', + _separator2: 'tab container', verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'}, @@ -37,7 +37,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro 'colorFill', 'colorStroke', 'alphaStroke', 'alphaFillOff', ], { - _children: 'children', + _children:'children', widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'}, tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously'}, diff --git a/src/client/widgets/containers/tab.js b/src/client/widgets/containers/tab.js index f6b75470..9374ee97 100644 --- a/src/client/widgets/containers/tab.js +++ b/src/client/widgets/containers/tab.js @@ -16,7 +16,7 @@ class Tab extends Panel { return Widget.defaults({ - _panel: 'panel', + _class_specific: 'panel', label: {type: 'string|boolean', value: 'auto', help: [ 'Set to `false` to hide completely', @@ -27,7 +27,7 @@ class Tab extends Panel { traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, // detached: {type: 'boolean', value: true, help: 'Set to `false` if the tab contains `frame` widgets that should not be reloaded when the tab opens'}, - _panel_widgets: 'panel: widget container', + _separator1: 'widget container', layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'}, justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'}, @@ -35,7 +35,7 @@ class Tab extends Panel { scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, - _panel_tabs: 'panel: tab container', + _separator2: 'tab container', verticalTabs: {type: 'boolean', value: false, help: 'Set to `true` to display for vertical tab layout'}, @@ -44,7 +44,7 @@ class Tab extends Panel { 'colorStroke', 'alphaStroke', 'alphaFillOff', 'alphaFillOn' ], { - _children: 'children', + _children:'children', widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'}, tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously'}, diff --git a/src/client/widgets/frames/html.js b/src/client/widgets/frames/html.js index 26eeb060..650ef46a 100644 --- a/src/client/widgets/frames/html.js +++ b/src/client/widgets/frames/html.js @@ -25,7 +25,7 @@ class Html extends StaticProperties(Widget, {bypass: true}) { return super.defaults({ - _html:'html', + _class_specific: 'html', html: {type: 'string', value: '', help: [ 'Allowed HTML tags:', diff --git a/src/client/widgets/frames/image.js b/src/client/widgets/frames/image.js index 4374e17c..86a4fb1f 100644 --- a/src/client/widgets/frames/image.js +++ b/src/client/widgets/frames/image.js @@ -15,7 +15,7 @@ module.exports = class Image extends StaticProperties(Widget, {bypass: true}) { return super.defaults({ - _image:'image', + _class_specific: 'image', size: {type: 'string', value: 'cover', help: 'CSS background-size'}, position: {type: 'string', value: 'center', help: 'CSS background-position'}, diff --git a/src/client/widgets/frames/svg.js b/src/client/widgets/frames/svg.js index 70f6250f..fbe417c7 100644 --- a/src/client/widgets/frames/svg.js +++ b/src/client/widgets/frames/svg.js @@ -16,7 +16,7 @@ class Svg extends StaticProperties(Widget, {bypass: true}) { return super.defaults({ - _svg:'svg', + _class_specific: 'svg', svg: {type: 'string', value: '', help: [ 'Svg xml definition:', diff --git a/src/client/widgets/graphs/eq.js b/src/client/widgets/graphs/eq.js index 9499af4c..6dfbc170 100644 --- a/src/client/widgets/graphs/eq.js +++ b/src/client/widgets/graphs/eq.js @@ -15,7 +15,7 @@ class Eq extends StaticProperties(Plot, {logScaleX: false, logScaleY:false, smoo return Widget.defaults({ - _eq:'eq', + _class_specific: 'eq', filters: {type: 'array', value: '', help: [ 'Each item must be an object with the following properties', diff --git a/src/client/widgets/graphs/plot.js b/src/client/widgets/graphs/plot.js index 82b66250..d1edd1ac 100644 --- a/src/client/widgets/graphs/plot.js +++ b/src/client/widgets/graphs/plot.js @@ -16,7 +16,7 @@ module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, inte return super.defaults({ - _plot:'plot', + _class_specific: 'plot', rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'}, rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'}, diff --git a/src/client/widgets/graphs/visualizer.js b/src/client/widgets/graphs/visualizer.js index ee70fb93..fd100213 100644 --- a/src/client/widgets/graphs/visualizer.js +++ b/src/client/widgets/graphs/visualizer.js @@ -17,7 +17,7 @@ class Visualizer extends StaticProperties(Plot, {rangeX: {min: '', max: ''}, dot return Widget.defaults({ - _visualizer:'visualizer', + _class_specific: 'visualizer', duration: {type: 'number', value: 1, help: 'Defines visualization duration in seconds'}, framerate: {type: 'number', value: 30, help: 'Defines visualization framerate'}, diff --git a/src/client/widgets/indicators/led.js b/src/client/widgets/indicators/led.js index 8bdd83a0..41dffdba 100644 --- a/src/client/widgets/indicators/led.js +++ b/src/client/widgets/indicators/led.js @@ -15,7 +15,7 @@ module.exports = class Led extends StaticProperties(Widget, {bypass: true, inter return super.defaults({ - _led:'led', + _class_specific: 'led', mode: {type: 'string', value: 'intensity', choices: ['intensity', 'color'], help: 'Defines how value is interpreted (see `value`)'}, range: {type: 'object', value: {min:0, max:1}, help: 'Value range'}, diff --git a/src/client/widgets/indicators/text.js b/src/client/widgets/indicators/text.js index e873d485..174a8195 100644 --- a/src/client/widgets/indicators/text.js +++ b/src/client/widgets/indicators/text.js @@ -15,7 +15,7 @@ module.exports = class Text extends StaticProperties(Widget, {bypass: true, inte return super.defaults({ - _text: 'text', + _class_specific: 'text', vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'}, wrap: {type: 'boolean', value: false, help: [ diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index 5337e835..6fc16004 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -13,7 +13,7 @@ class CanvasWidget extends Canvas { return super.defaults({ - _canvas:'canvas', + _class_specific: 'canvas', onCreate: {type: 'string', value: '', help: ' '}, diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 400f8551..218e84f1 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -19,7 +19,7 @@ module.exports = class MultiXy extends Pad { return super.defaults({ - _mutlixy: 'multi xy', + _class_specific: 'multi xy', points: {type: 'integer|array', value: 2, help: [ 'Defines the number of points on the pad', @@ -27,7 +27,7 @@ module.exports = class MultiXy extends Pad { ]}, - _xy: 'xy', + _separator: 'xy', pointSize: {type: 'integer', value: 20, help: 'Defines the points\' size'}, snap: {type: 'boolean', value: false, help: [ diff --git a/src/client/widgets/pads/rgb.js b/src/client/widgets/pads/rgb.js index e05f5505..025f20a2 100644 --- a/src/client/widgets/pads/rgb.js +++ b/src/client/widgets/pads/rgb.js @@ -20,7 +20,7 @@ module.exports = class Rgb extends Widget { return super.defaults({ - _rgb:'rgb', + _class_specific: 'rgb', snap: {type: 'boolean', value: false, help: [ 'By default, the points are dragged from their initial position.', diff --git a/src/client/widgets/pads/xy.js b/src/client/widgets/pads/xy.js index 63b2c9f1..cfa03061 100644 --- a/src/client/widgets/pads/xy.js +++ b/src/client/widgets/pads/xy.js @@ -17,7 +17,7 @@ module.exports = class Xy extends Pad { return super.defaults({ - _xy:'xy', + _class_specific: 'xy', pointSize: {type: 'integer', value: 20, help: 'Defines the points\' size'}, snap: {type: 'boolean', value: false, help: [ diff --git a/src/client/widgets/scripts/gyro-archive.js b/src/client/widgets/scripts/gyro-archive.js index ebd83765..b3baa851 100644 --- a/src/client/widgets/scripts/gyro-archive.js +++ b/src/client/widgets/scripts/gyro-archive.js @@ -18,7 +18,7 @@ class Gyroscope extends Widget { return super.defaults({ - _gyroscope: 'gyroscope', + _class_specific: 'gyroscope', frequency: {type: 'number', value: 30, help: 'Value update frequency (updates per seconds)'}, normalize: {type: 'boolean', value: true, help: 'Normalize gravity related values'}, diff --git a/src/client/widgets/scripts/script.js b/src/client/widgets/scripts/script.js index 7cf234ea..81de6192 100644 --- a/src/client/widgets/scripts/script.js +++ b/src/client/widgets/scripts/script.js @@ -16,12 +16,12 @@ class Script extends Widget { return super.defaults({ - _script: 'script', + _class_specific: 'script', event: {type: 'string', value: 'value', choices: ['value', 'keyboard'], help: 'Define which events trigger the script\'s execution.'}, script: {}, - _eventKey: 'event: keyboard', + _separator: 'event: keyboard', keyBinding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see KeyboardJS documentation)'}, keyRepeat: {type: 'boolean', value: true, help: 'Set to `false` to prevent keydown repeats when holding the key combo pressed'}, diff --git a/src/client/widgets/sliders/encoder.js b/src/client/widgets/sliders/encoder.js index 582c5d7f..563b8b41 100644 --- a/src/client/widgets/sliders/encoder.js +++ b/src/client/widgets/sliders/encoder.js @@ -15,7 +15,7 @@ module.exports = class Encoder extends StaticProperties(Knob, {angle: 360, range return Widget.defaults({ - _encoder: 'encoder', + _class_specific: 'encoder', ticks: {type: 'number', value: 360, help: 'defines the granularity / verbosity of the encoder (number of step for a 360° arc)'}, back: {type: '*', value: -1, help: 'Defines which value is sent when rotating the encoder anticlockwise'}, diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index a9d2a581..dddbf368 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -13,7 +13,7 @@ module.exports = class Fader extends Slider { return super.defaults({ - _fader:'fader', + _class_specific: 'fader', design: {type: 'string', value: 'default', choices: ['default', 'round', 'compact'], help: 'Design style'}, horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display the fader horizontally'}, diff --git a/src/client/widgets/sliders/knob.js b/src/client/widgets/sliders/knob.js index d80ca65c..8cd7e1c7 100644 --- a/src/client/widgets/sliders/knob.js +++ b/src/client/widgets/sliders/knob.js @@ -13,7 +13,7 @@ module.exports = class Knob extends Slider { return super.defaults({ - _knob:'knob', + _class_specific: 'knob', mode: {type: 'string', value: 'vertical', choices: ['vertical', 'circular', 'snap'], help: [ '- `circular`: relative move in circular motion', diff --git a/src/scss/ui/inspector.scss b/src/scss/ui/inspector.scss index 5ea66c90..ad49574f 100644 --- a/src/scss/ui/inspector.scss +++ b/src/scss/ui/inspector.scss @@ -89,7 +89,6 @@ osc-inspector-category { .category-header { position: relative; - text-transform: none; cursor: pointer; height: $header-height; line-height: $header-height; @@ -115,7 +114,23 @@ osc-inspector-category { } - osc-inspector-field { + .separator { + height: $header-height; + line-height: $header-height + 1; + margin: 8rem 0; + --alpha-fill: 0.75; + position: relative; + @include pseudo-fill($z: -1); + padding: 0 16rem; + opacity: 0.75; + --color-fill: var(--color-background); + &:after { + left:-($padding - 1); + right:-($padding - 1); + } + } + + osc-inspector-field, .separator { display: none; } --alpha-fill: 1; @@ -132,6 +147,9 @@ osc-inspector-category { osc-inspector-field { display: flex; } + .separator { + display: block + } } .category-header + osc-inspector-field {