tweaked IDE control bar toggle buttons

pull/95/head
jmoenig 2020-05-06 11:48:26 +02:00
rodzic d9db1e5dff
commit a47ab0050d
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -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];

Wyświetl plik

@ -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();
}