WS: Add strip labels in the mixer demo

Plus some minor widget code and layout improvements
This commit is contained in:
Luciano Iam 2020-07-25 17:45:39 +02:00 committed by Robin Gareus
parent c8bc9a25b3
commit 0b71764f44
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 54 additions and 27 deletions

View file

@ -17,10 +17,40 @@
*/
import loadToolkit from './tkloader.js';
import { BaseContainer, BaseControl } from './widget.js';
import { BaseWidget, BaseContainer, BaseControl } from './widget.js';
class Widget extends BaseWidget {
constructor (tk) {
super();
this.tk = tk;
}
get element () {
return this.tk.element;
}
}
export class Label extends Widget {
constructor () {
super(new TK.Label());
}
set text (text) {
this.tk.set('label', text);
}
}
class Control extends BaseControl {
constructor (tk) {
super();
this.tk = tk;
}
get element () {
return this.tk.element;
}
@ -30,7 +60,7 @@ class Control extends BaseControl {
class RangeControl extends Control {
constructor (tk) {
super();
super(tk);
this.tk = tk;
this.lastValue = NaN;