From 4a8a548c53549e06399757e41576e7617fad8f73 Mon Sep 17 00:00:00 2001 From: moodykeke Date: Thu, 6 Nov 2025 09:39:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(accessibility):=20=E6=8F=90=E5=8D=87?= =?UTF-8?q?=20ToggleMorph=20=E5=9C=A8=E6=98=8E=E4=BA=AE=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E4=B8=8B=E7=9A=84=E5=AF=B9=E6=AF=94=E5=BA=A6=EF=BC=88=E6=9B=B4?= =?UTF-8?q?=E6=B7=B1=E8=BE=B9=E6=A1=86+=E6=B7=B1=E8=89=B2=E5=8B=BE?= =?UTF-8?q?=E9=80=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/widgets.js b/src/widgets.js index 09055f0ac0..5b93b6153d 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -1120,6 +1120,11 @@ ToggleMorph.prototype.init = function ( environment, hint ); + // increase contrast for checkboxes/radio in bright theme for accessibility + if (IDE_Morph && IDE_Morph.prototype && IDE_Morph.prototype.isBright) { + this.outlineColor = new Color(120, 120, 120); + this.outlineGradient = false; + } this.fixLayout(); this.refresh(); }; @@ -1183,6 +1188,9 @@ ToggleMorph.prototype.createLabel = function () { } } if (this.tick === null) { + var tickColor = (IDE_Morph && IDE_Morph.prototype && IDE_Morph.prototype.isBright) + ? IDE_Morph.prototype.buttonLabelColor || new Color(70, 70, 70) + : new Color(240, 240, 240); this.tick = new StringMorph( localize(this.labelString), this.fontSize, @@ -1191,7 +1199,7 @@ ToggleMorph.prototype.createLabel = function () { false, false, shading ? new Point(1, 1) : null, - new Color(240, 240, 240) + tickColor ); this.add(this.tick); } From 87d5ab35ce4872244d5a89406202590cebf0142f Mon Sep 17 00:00:00 2001 From: moodykeke Date: Thu, 6 Nov 2025 09:43:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(accessibility):=20=E6=98=8E=E4=BA=AE?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=B8=8B=E5=A4=8D=E9=80=89=E6=A1=86=E5=86=8D?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=EF=BC=88=E5=8A=A0=E6=B7=B1=E5=A1=AB=E5=85=85?= =?UTF-8?q?=E8=89=B2+=E5=8B=BE=E9=80=89=E5=8A=A0=E5=A4=A72pt=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/widgets.js b/src/widgets.js index 5b93b6153d..d0497d4b1a 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -1124,6 +1124,8 @@ ToggleMorph.prototype.init = function ( if (IDE_Morph && IDE_Morph.prototype && IDE_Morph.prototype.isBright) { this.outlineColor = new Color(120, 120, 120); this.outlineGradient = false; + // slightly darker fill than panel background for clearer contrast + this.color = new Color(210, 210, 210); } this.fixLayout(); this.refresh(); @@ -1188,12 +1190,14 @@ ToggleMorph.prototype.createLabel = function () { } } if (this.tick === null) { - var tickColor = (IDE_Morph && IDE_Morph.prototype && IDE_Morph.prototype.isBright) - ? IDE_Morph.prototype.buttonLabelColor || new Color(70, 70, 70) - : new Color(240, 240, 240); + var isBright = (IDE_Morph && IDE_Morph.prototype && IDE_Morph.prototype.isBright), + tickColor = isBright + ? IDE_Morph.prototype.buttonLabelColor || new Color(70, 70, 70) + : new Color(240, 240, 240), + tickSize = this.fontSize + (isBright ? 2 : 0); // enlarge tick a bit in bright mode this.tick = new StringMorph( localize(this.labelString), - this.fontSize, + tickSize, this.fontStyle, true, false,