revert empty category indication for single palette mode

need to find a better mechanism...
snap7
jmoenig 2021-11-15 18:59:24 +01:00
rodzic af68f7a78e
commit 0073666bd4
3 zmienionych plików z 0 dodań i 29 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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) {

Wyświetl plik

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