From a47ab0050d9794227efb84f13596dba65f53e319 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Wed, 6 May 2020 11:48:26 +0200 Subject: [PATCH] tweaked IDE control bar toggle buttons --- src/gui.js | 4 ++++ src/widgets.js | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui.js b/src/gui.js index 94502375..af2ca221 100644 --- a/src/gui.js +++ b/src/gui.js @@ -730,6 +730,7 @@ IDE_Morph.prototype.createControlBar = function () { () => this.isSmallStage // query ); + button.hasNeutralBackground = true; button.corner = 12; button.color = colors[0]; button.highlightColor = colors[1]; @@ -759,6 +760,7 @@ IDE_Morph.prototype.createControlBar = function () { () => this.isAppMode // query ); + button.hasNeutralBackground = true; button.corner = 12; button.color = colors[0]; button.highlightColor = colors[1]; @@ -853,6 +855,7 @@ IDE_Morph.prototype.createControlBar = function () { () => this.isPaused() // query ); + button.hasNeutralBackground = true; button.corner = 12; button.color = colors[0]; button.highlightColor = colors[1]; @@ -975,6 +978,7 @@ IDE_Morph.prototype.createControlBar = function () { () => !isNil(this.cloud.username) // query ); + button.hasNeutralBackground = true; button.corner = 12; button.color = colors[0]; button.highlightColor = colors[1]; diff --git a/src/widgets.js b/src/widgets.js index b59f2066..097867c4 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -85,7 +85,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph, ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences, ScrollFrameMorph, MenuItemMorph, Note*/ -modules.widgets = '2020-May-03'; +modules.widgets = '2020-May-06'; var PushButtonMorph; var ToggleButtonMorph; @@ -560,6 +560,7 @@ ToggleButtonMorph.prototype.init = function ( this.minWidth = minWidth || null; this.hasPreview = hasPreview || false; this.isPicture = isPicture || false; + this.hasNeutralBackground = false; this.trueStateLabel = null; // initialize inherited properties: @@ -587,7 +588,7 @@ ToggleButtonMorph.prototype.init = function ( ToggleButtonMorph.prototype.mouseEnter = function () { var contents = this.hint instanceof Function ? this.hint() : this.hint; - if (!this.state) { + if (!this.state || this.hasNeutralBackground) { this.userState = 'highlight'; this.rerender(); } @@ -597,7 +598,7 @@ ToggleButtonMorph.prototype.mouseEnter = function () { }; ToggleButtonMorph.prototype.mouseLeave = function () { - if (!this.state) { + if (!this.state || this.hasNeutralBackground) { this.userState = 'normal'; this.rerender(); }