From 2b4cb9ec5fb2031f6a93247e959419612b65506e Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 21 Feb 2020 18:45:00 +0100 Subject: [PATCH] more migration for toggle button label variants --- snap.html | 8 ++++---- src/widgets.js | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/snap.html b/snap.html index 636d8611..d54a4ad0 100755 --- a/snap.html +++ b/snap.html @@ -35,20 +35,20 @@ window.onload = function () { world = new WorldMorph(document.getElementById('world')); world.isDevMode = false; - //new IDE_Morph().openIn(world); - + // new IDE_Morph().openIn(world); +///* var t = new ToggleButtonMorph( null, null, () => world.isDevMode = !world.isDevMode, - new SymbolMorph('gears'), //'dev mode', + [new SymbolMorph('gears'), new SymbolMorph('globe')], //'dev mode', () => world.isDevMode, null, 'hacker possibilities' ); t.setPosition(new Point(100, 100)); world.add(t); - +//*/ loop(); }; function loop() { diff --git a/src/widgets.js b/src/widgets.js index 553067aa..a6860093 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -820,13 +820,15 @@ ToggleButtonMorph.prototype.createLabel = function () { this.labelShadowOffset : none; this.label.shadowColor = this.labelShadowColor; this.label.color = this.labelColor; - this.label.drawNew(); + this.label.fixLayout(); + this.label.rerender(); this.trueStateLabel.shadowOffset = shading ? this.labelShadowOffset : none; this.trueStateLabel.shadowColor = this.labelShadowColor; this.trueStateLabel.color = this.labelColor; - this.trueStateLabel.drawNew(); + this.trueStateLabel.fixLayout(); + this.trueStateLabel.rerender(); } } else if (this.labelString[0] instanceof Morph) { this.label = this.labelString[0].fullCopy();