From e34acb26537f6a4dc3e17d4d33859792f4a7f3d7 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 5 Jul 2021 23:27:20 +0200 Subject: [PATCH] replaced checkboxes in custom block context menus with symbols --- HISTORY.md | 1 + src/byob.js | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 37b16a0f..f099e1b2 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -24,6 +24,7 @@ * added new "serial ports" library * added jshint esversion tags * gui: unified palette: don't animate scrolling if delta is zero +* byob: replaced checkboxes in custom block context menus with symbols ### 2021-07-04 * fixed audio_comp library "plot sound" block to work with translations, thanks, Hans, for the report! diff --git a/src/byob.js b/src/byob.js index 066a517b..31b27b59 100644 --- a/src/byob.js +++ b/src/byob.js @@ -1081,10 +1081,17 @@ CustomCommandBlockMorph.prototype.userMenu = function () { menu; function addOption(label, toggle, test, onHint, offHint) { - var on = '\u2611 ', - off = '\u2610 '; menu.addItem( - (test ? on : off) + localize(label), + [ + test ? new SymbolMorph( + 'checkedBox', + MorphicPreferences.menuFontSize * 0.75 + ) : new SymbolMorph( + 'rectangle', + MorphicPreferences.menuFontSize * 0.75 + ), + localize(label) + ], toggle, test ? onHint : offHint );