diff --git a/CHANGELOG.md b/CHANGELOG.md index 5147325e..cc61fe91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - cli - added `--instance-name` option to differenciate mulitple instances in zeroconf networks - widgets + - inputs: renamed `input`'s property `horizontal` to `vertical` to match how the widget actually displays - sliders: **new** `range` widget - plots: **new** `image` widget - remote control diff --git a/app/examples/ardour.json b/app/examples/ardour.json index 8168f6f3..e912cc0a 100644 --- a/app/examples/ardour.json +++ b/app/examples/ardour.json @@ -281,7 +281,6 @@ "label": false, "width": 50, "color": "auto", - "css": "font-size:90%;", "horizontal": true, "stretch": true, "border": false, @@ -310,19 +309,20 @@ "widgetId": "trim_knob_@{parent.variables.n}", "linkId": "", "unit": "", - "horizontal": true, "editable": true, "precision": 1, "target": [], "value": "", "address": "/trim_input_@{parent.variables.n}", "width": "auto", - "css": "" + "css": "", + "vertical": true } ], "_style": "style", "_children": "children", "scroll": true, + "css": "", "_geometry": "geometry", "_panel": "panel", "layout": "", @@ -583,7 +583,6 @@ "label": false, "unit": "dB", "height": 30, - "horizontal": false, "color": "auto", "css": "margin:5rem 5rem 0", "widgetId": "fader_@{parent.variables.n}", @@ -592,7 +591,8 @@ "precision": 2, "preArgs": [], "target": [], - "address": "/fader_input_@{parent.variables.n}" + "address": "/fader_input_@{parent.variables.n}", + "vertical": false }, { "type": "fader", @@ -938,7 +938,6 @@ "label": false, "width": 50, "color": "auto", - "css": "font-size:90%;", "horizontal": true, "stretch": true, "border": false, @@ -967,19 +966,20 @@ "widgetId": "mastertrim", "linkId": "", "unit": "", - "horizontal": true, "editable": true, "precision": 1, "target": [], "value": "", "address": "/mastertrim_input", "width": "auto", - "css": "" + "css": "", + "vertical": true } ], "_style": "style", "_children": "children", "scroll": true, + "css": "", "_geometry": "geometry", "_panel": "panel", "layout": "", @@ -1192,7 +1192,6 @@ "label": false, "unit": "dB", "height": 30, - "horizontal": false, "color": "auto", "css": "margin:5rem 5rem 0", "widgetId": "Master", @@ -1201,7 +1200,8 @@ "precision": 2, "preArgs": [], "target": [], - "address": "/master_input" + "address": "/master_input", + "vertical": false }, { "type": "fader", @@ -1922,7 +1922,6 @@ "label": false, "width": 50, "color": "auto", - "css": "font-size:90%;", "horizontal": true, "stretch": true, "border": false, @@ -1952,18 +1951,19 @@ "widgetId": "select_trim_knob", "linkId": "", "unit": "", - "horizontal": true, "editable": true, "precision": 1, "target": [], "address": "/select_trim_input", "value": "", - "width": "auto" + "width": "auto", + "vertical": true } ], "_style": "style", "_children": "children", "scroll": true, + "css": "", "_geometry": "geometry", "_panel": "panel", "layout": "", @@ -2320,7 +2320,6 @@ "label": false, "unit": "dB", "height": 30, - "horizontal": false, "color": "auto", "css": "margin:5rem 5rem 0", "widgetId": "fader_select", @@ -2329,7 +2328,8 @@ "precision": 2, "preArgs": [], "target": [], - "address": "/fader_input_select" + "address": "/fader_input_select", + "vertical": false }, { "type": "fader", diff --git a/src/browser/js/app/widgets/inputs/input.js b/src/browser/js/app/widgets/inputs/input.js index f7ca86cf..6630af03 100644 --- a/src/browser/js/app/widgets/inputs/input.js +++ b/src/browser/js/app/widgets/inputs/input.js @@ -26,7 +26,7 @@ module.exports = class Input extends _canvas_base { _input:'input', - horizontal:false, + vertical:false, unit: '', widgetId:'', editable:true, @@ -55,8 +55,8 @@ module.exports = class Input extends _canvas_base { this.value = '' this.stringValue = '' - if (this.getProp('horizontal')) { - this.widget.addClass('horizontal') + if (this.getProp('vertical')) { + this.widget.addClass('vertical') } if (this.getProp('editable')) { @@ -132,7 +132,7 @@ module.exports = class Input extends _canvas_base { super.resizeHandle(...arguments) - if (this.getProp('horizontal')){ + if (this.getProp('vertical')){ this.ctx.setTransform(1, 0, 0, 1, 0, 0) this.ctx.rotate(-Math.PI/2) this.ctx.translate(-this.height, 0) @@ -177,8 +177,8 @@ module.exports = class Input extends _canvas_base { draw() { var v = this.stringValue, - width = this.getProp('horizontal') ? this.height : this.width, - height = !this.getProp('horizontal') ? this.height : this.width + width = this.getProp('vertical') ? this.height : this.width, + height = !this.getProp('vertical') ? this.height : this.width if (this.getProp('unit') && v.length) v += ' ' + this.getProp('unit') diff --git a/src/browser/js/app/widgets/sliders/_sliders_base.js b/src/browser/js/app/widgets/sliders/_sliders_base.js index bca7ef17..688d93c3 100644 --- a/src/browser/js/app/widgets/sliders/_sliders_base.js +++ b/src/browser/js/app/widgets/sliders/_sliders_base.js @@ -75,7 +75,7 @@ module.exports = class _sliders_base extends _canvas_base { ...Input.defaults(), precision:this.getProp('precision'), unit:this.getProp('unit'), - horizontal: this.getProp('type') == 'fader' && this.getProp('compact') && !this.getProp('horizontal') + vertical: this.getProp('type') == 'fader' && this.getProp('compact') && !this.getProp('horizontal') }, parent:this, parentNode:this.widget }) diff --git a/src/browser/js/app/widgets/sliders/range.js b/src/browser/js/app/widgets/sliders/range.js index 0c3b4353..76d404bb 100644 --- a/src/browser/js/app/widgets/sliders/range.js +++ b/src/browser/js/app/widgets/sliders/range.js @@ -183,7 +183,7 @@ module.exports = class Range extends _widgets_base { props:{...Input.defaults(), precision:this.getProp('precision'), unit:this.getProp('unit'), - horizontal: this.getProp('compact') && !this.getProp('horizontal') + vertical: this.getProp('compact') && !this.getProp('horizontal') }, parent:this, parentNode:this.widget, }) diff --git a/src/browser/scss/widgets/_inputs.scss b/src/browser/scss/widgets/_inputs.scss index 873c5908..503a01ec 100644 --- a/src/browser/scss/widgets/_inputs.scss +++ b/src/browser/scss/widgets/_inputs.scss @@ -2,7 +2,7 @@ width: 100rem; height: 60rem; padding:1rem; - .horizontal { + .vertical { input { transform: rotate(-90deg); vertical-align: middle;