From 0073666bd481c79b6ea787fae7d53bbcb83f9e02 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 15 Nov 2021 18:59:24 +0100 Subject: [PATCH] revert empty category indication for single palette mode need to find a better mechanism... --- HISTORY.md | 1 - src/gui.js | 12 ------------ src/objects.js | 16 ---------------- 3 files changed, 29 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index dab8c1fe..94b8a643 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -68,7 +68,6 @@ * gui, translations: removed old hidden "virtual keyboard" setting * gui: removed old hidden "project urls" setting * gui: removed hidden "cache inputs" setting (only used for debugging the evaluator) -* gui, objects: indicate empty categories in single-palette mode ### 2021-11-14 * locale: contextualize translations diff --git a/src/gui.js b/src/gui.js index 6404f83b..c8003179 100644 --- a/src/gui.js +++ b/src/gui.js @@ -1276,14 +1276,6 @@ IDE_Morph.prototype.createCategories = function () { if (cat.state) { cat.scrollIntoView(); } - - // indicate whether a category is empty of blocks to show - // currently only supported in unified palette mode - if (myself.currentSprite.emptyCategoriesCache[cat.category]) { - cat.disable(); - } else { - cat.enable(); - } }); }; @@ -1330,7 +1322,6 @@ IDE_Morph.prototype.createCategories = function () { true // has preview ); - button.category = category; button.corner = 8; button.padding = 0; button.labelShadowOffset = new Point(-1, -1); @@ -1367,7 +1358,6 @@ IDE_Morph.prototype.createCategories = function () { true // has preview ); - button.category = category; button.corner = 8; button.padding = 0; button.labelShadowOffset = new Point(-1, -1); @@ -2816,7 +2806,6 @@ IDE_Morph.prototype.selectSprite = function (sprite) { } this.currentSprite = sprite; this.scene.currentSprite = sprite; - this.categories.refresh(); // indicate empty categories in unified palette this.createPalette(); this.createSpriteBar(); this.createSpriteEditor(); @@ -6267,7 +6256,6 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall, forcedRatio) { IDE_Morph.prototype.toggleUnifiedPalette = function () { this.setUnifiedPalette(!this.scene.unifiedPalette); - this.categories.refresh(); // update empty categories in single palette mode }; IDE_Morph.prototype.setUnifiedPalette = function (bool) { diff --git a/src/objects.js b/src/objects.js index 2659b484..54085d8d 100644 --- a/src/objects.js +++ b/src/objects.js @@ -1870,7 +1870,6 @@ SpriteMorph.prototype.init = function (globals) { this.primitivesCache = {}; // not to be serialized (!) this.paletteCache = {}; // not to be serialized (!) - this.emptyCategoriesCache = {}; // not to be serialized; this.rotationOffset = ZERO; // not to be serialized (!) this.idx = 0; // not to be serialized (!) - used for de-serialization @@ -1936,7 +1935,6 @@ SpriteMorph.prototype.fullCopy = function (forClone) { c.freqPlayer = null; c.primitivesCache = {}; c.paletteCache = {}; - c.emptyCategoriesCache = {}; c.imageData = {}; c.cachedColorDimensions = c.color[this.penColorModel](); arr = []; @@ -3013,14 +3011,6 @@ SpriteMorph.prototype.freshPalette = function (category) { searchButton, makeButton; - function isEmptyCategory(blocks) { - return blocks.filter(each => - each instanceof BlockMorph && !myself.isHidingBlock(each) - ).length === 0; - } - - this.emptyCategoriesCache = {}; - palette.owner = this; palette.padding = unit / 2; palette.color = this.paletteColor; @@ -3113,11 +3103,6 @@ SpriteMorph.prototype.freshPalette = function (category) { each !== '-' && each !== '='); } - // update the empty categories cache - if (isEmptyCategory(primitives) && isEmptyCategory(customs)) { - this.emptyCategoriesCache[category] = true; - } - return blocks.concat( showHeader ? header : [], primitives, @@ -7787,7 +7772,6 @@ StageMorph.prototype.init = function (globals) { this.keysPressed = {}; // for handling keyboard events, do not persist this.primitivesCache = {}; // not to be serialized (!) this.paletteCache = {}; // not to be serialized (!) - this.emptyCategoriesCache = {}; // not to be serialized (!) this.lastAnswer = ''; // last user input, do not persist this.activeSounds = []; // do not persist