diff --git a/app/main/electron-app.js b/app/main/electron-app.js index 74f1452e..6ff88746 100644 --- a/app/main/electron-app.js +++ b/app/main/electron-app.js @@ -21,19 +21,4 @@ app.on('window-all-closed', function() { } }) -app.on('ready', () => { - tray = new Tray(path.resolve(__dirname + '/../../resources/images/logo.png')) - const contextMenu = Menu.buildFromTemplate([ - {label: 'New client window', type: 'normal'}, - {label: 'Item2', type: 'radio'} - ]) - - // Make a change to the context menu - contextMenu.items[1].checked = false - - tray.setToolTip(settings.read('appName')) - // Call this again for Linux because we modified the context menu - tray.setContextMenu(contextMenu) -}) - module.exports = app diff --git a/src/browser/js/app/widgets/inputs/input.js b/src/browser/js/app/widgets/inputs/input.js index e56e2a92..8765c900 100644 --- a/src/browser/js/app/widgets/inputs/input.js +++ b/src/browser/js/app/widgets/inputs/input.js @@ -54,7 +54,6 @@ module.exports = class Input extends _canvas_base { this.value = '' this.stringValue = '' - if (this.getProp('editable')) { this.canvas.on('focus', this.focus.bind(this)) @@ -111,21 +110,14 @@ module.exports = class Input extends _canvas_base { syncHandle(e) { - if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length) return + if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length || !e.widget) return - var widget = widgetManager.getWidgetById(e.id), - value - - for (var i=widget.length-1; i>=0; i--) { - if (widget[i].getValue) { - this.setValue(widget[i].getValue(), {...e.options, fromSync:true}) - return - } - } + this.setValue(e.widget.getValue(), {...e.options, internal:true}) } resizeHandle(){ + super.resizeHandle(...arguments) if (this.getProp('horizontal')){ @@ -149,19 +141,20 @@ module.exports = class Input extends _canvas_base { this.value = v } - this.stringValue = this.getStringValue() - this.draw() - - if (this.getProp('widgetId').length && !options.fromSync) { + if (!options.internal && this.getProp('widgetId').length) { var widget = widgetManager.getWidgetById(this.getProp('widgetId')) - options.hash = this.hash for (var i=widget.length-1; i>=0; i--) { if (widget[i].setValue) { widget[i].setValue(this.value, options) + this.setValue(widget[i].getValue(), {...options, internal:true}) + return } } } + this.stringValue = this.getStringValue() + this.draw() + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options}) if (options.send && !options.fromSync) this.sendValue() @@ -173,7 +166,7 @@ module.exports = class Input extends _canvas_base { width = this.getProp('horizontal') ? this.height : this.width, height = !this.getProp('horizontal') ? this.height : this.width - if (this.getProp('unit')) v += ' ' + this.getProp('unit') + if (this.getProp('unit') && v.length) v += ' ' + this.getProp('unit') this.clear() diff --git a/src/browser/scss/widgets/_inputs.scss b/src/browser/scss/widgets/_inputs.scss index ae226291..fa1cbf77 100644 --- a/src/browser/scss/widgets/_inputs.scss +++ b/src/browser/scss/widgets/_inputs.scss @@ -38,7 +38,9 @@ vertical-align: top; // font-weight: bold; letter-spacing: 1rem; - + &:focus { + color:var(--color-custom); + } } canvas { height: 100%; @@ -50,10 +52,7 @@ display: none; } - &:focus { - color:var(--color-accent); - } } }