improved category button rendering for flat mode "make-a-block" dialog

pull/95/head
jmoenig 2020-05-03 16:25:38 +02:00
rodzic 55e3e8b407
commit 485c33da90
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -108,7 +108,7 @@ BooleanSlotMorph, XML_Serializer, SnapTranslator*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.byob = '2020-April-28'; modules.byob = '2020-May-03';
// Declarations // Declarations
@ -1666,8 +1666,8 @@ BlockDialogMorph.prototype.createCategoryButtons = function () {
BlockDialogMorph.prototype.addCategoryButton = function (category) { BlockDialogMorph.prototype.addCategoryButton = function (category) {
var labelWidth = 75, var labelWidth = 75,
colors = [ colors = [
SpriteMorph.prototype.paletteColor, IDE_Morph.prototype.frameColor,
SpriteMorph.prototype.paletteColor.darker(50), IDE_Morph.prototype.frameColor.darker(MorphicPreferences.isFlat ? 5 : 50),
SpriteMorph.prototype.blockColor[category] SpriteMorph.prototype.blockColor[category]
], ],
button; button;
@ -1700,6 +1700,9 @@ BlockDialogMorph.prototype.addCategoryButton = function (category) {
button.labelShadowOffset = new Point(-1, -1); button.labelShadowOffset = new Point(-1, -1);
button.labelShadowColor = colors[1]; button.labelShadowColor = colors[1];
button.labelColor = IDE_Morph.prototype.buttonLabelColor; button.labelColor = IDE_Morph.prototype.buttonLabelColor;
if (MorphicPreferences.isFlat) {
button.labelPressColor = new Color(255, 255, 255);
}
button.contrast = this.buttonContrast; button.contrast = this.buttonContrast;
button.fixLayout(); button.fixLayout();
button.refresh(); button.refresh();