refactored gui.js with new Morphic constants

pull/95/head
jmoenig 2020-07-01 18:52:10 +02:00
rodzic f02b3be075
commit 16d7374730
2 zmienionych plików z 24 dodań i 24 usunięć

Wyświetl plik

@ -10,7 +10,7 @@
<script src="src/blocks.js?version=2020-07-01"></script>
<script src="src/threads.js?version=2020-06-27"></script>
<script src="src/objects.js?version=2020-07-01"></script>
<script src="src/gui.js?version=2020-06-28"></script>
<script src="src/gui.js?version=2020-07-01"></script>
<script src="src/paint.js?version=2020-05-17"></script>
<script src="src/lists.js?version=2020-05-18"></script>
<script src="src/byob.js?version=2020-07-01"></script>

Wyświetl plik

@ -71,14 +71,14 @@ InputSlotDialogMorph, ScriptsMorph, isNil, SymbolMorph, fontHeight, localize,
BlockExportDialogMorph, BlockImportDialogMorph, SnapTranslator, List, ArgMorph,
Uint8Array, HandleMorph, SVG_Costume, TableDialogMorph, CommentMorph, saveAs,
CommandBlockMorph, BooleanSlotMorph, RingReporterSlotMorph, ScriptFocusMorph,
BlockLabelPlaceHolderMorph, SpeechBubbleMorph, XML_Element, WatcherMorph,
BlockLabelPlaceHolderMorph, SpeechBubbleMorph, XML_Element, WatcherMorph, WHITE,
BlockRemovalDialogMorph,TableMorph, isSnapObject, isRetinaEnabled, SliderMorph,
disableRetinaSupport, enableRetinaSupport, isRetinaSupported, MediaRecorder,
Animation, BoxMorph, BlockEditorMorph, BlockDialogMorph, Note*/
Animation, BoxMorph, BlockEditorMorph, BlockDialogMorph, Note, ZERO, BLACK*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2020-June-28';
modules.gui = '2020-July-01';
// Declarations
@ -125,14 +125,14 @@ IDE_Morph.prototype.setDefaultDesign = function () {
IDE_Morph.prototype.groupColor
= SpriteMorph.prototype.paletteColor.lighter(5);
IDE_Morph.prototype.sliderColor = SpriteMorph.prototype.sliderColor;
IDE_Morph.prototype.buttonLabelColor = new Color(255, 255, 255);
IDE_Morph.prototype.buttonLabelColor = WHITE;
IDE_Morph.prototype.tabColors = [
IDE_Morph.prototype.groupColor.darker(50),
IDE_Morph.prototype.groupColor.darker(25),
IDE_Morph.prototype.groupColor
];
IDE_Morph.prototype.rotationStyleColors = IDE_Morph.prototype.tabColors;
IDE_Morph.prototype.appModeColor = new Color();
IDE_Morph.prototype.appModeColor = BLACK;
IDE_Morph.prototype.scriptsPaneTexture = this.scriptsTexture();
IDE_Morph.prototype.padding = 1;
@ -146,12 +146,12 @@ IDE_Morph.prototype.setDefaultDesign = function () {
= IDE_Morph.prototype.buttonLabelColor;
SyntaxElementMorph.prototype.contrast = 65;
ScriptsMorph.prototype.feedbackColor = new Color(255, 255, 255);
ScriptsMorph.prototype.feedbackColor = WHITE;
};
IDE_Morph.prototype.setFlatDesign = function () {
MorphicPreferences.isFlat = true;
SpriteMorph.prototype.paletteColor = new Color(255, 255, 255);
SpriteMorph.prototype.paletteColor = WHITE;
SpriteMorph.prototype.paletteTextColor = new Color(70, 70, 70);
StageMorph.prototype.paletteTextColor
= SpriteMorph.prototype.paletteTextColor;
@ -162,7 +162,7 @@ IDE_Morph.prototype.setFlatDesign = function () {
IDE_Morph.prototype.backgroundColor = new Color(220, 220, 230);
IDE_Morph.prototype.frameColor = new Color(240, 240, 245);
IDE_Morph.prototype.groupColor = new Color(255, 255, 255);
IDE_Morph.prototype.groupColor = WHITE;
IDE_Morph.prototype.sliderColor = SpriteMorph.prototype.sliderColor;
IDE_Morph.prototype.buttonLabelColor = new Color(70, 70, 70);
IDE_Morph.prototype.tabColors = [
@ -676,7 +676,7 @@ IDE_Morph.prototype.createLogo = function () {
myself.snapMenu();
};
this.logo.color = new Color();
this.logo.color = BLACK;
this.logo.setExtent(new Point(200, 28)); // dimensions are fixed
this.add(this.logo);
};
@ -742,7 +742,7 @@ IDE_Morph.prototype.createControlBar = function () {
button.labelShadowOffset = new Point(-1, -1);
button.labelShadowColor = colors[1];
button.labelColor = MorphicPreferences.isFlat ?
new Color(255, 255, 255)
WHITE
: this.buttonLabelColor;
button.contrast = this.buttonContrast;
// button.hint = 'stage size\nsmall & normal';
@ -1157,7 +1157,7 @@ IDE_Morph.prototype.createCategories = function () {
button.labelShadowColor = colors[1];
button.labelColor = myself.buttonLabelColor;
if (MorphicPreferences.isFlat) {
button.labelPressColor = new Color(255, 255, 255);
button.labelPressColor = WHITE;
}
button.fixLayout();
button.refresh();
@ -1444,8 +1444,8 @@ IDE_Morph.prototype.createSpriteBar = function () {
padlock.pressColor = tabColors[1];
padlock.tick.shadowOffset = MorphicPreferences.isFlat ?
new Point() : new Point(-1, -1);
padlock.tick.shadowColor = new Color(); // black
ZERO : new Point(-1, -1);
padlock.tick.shadowColor = BLACK;
padlock.tick.color = this.buttonLabelColor;
padlock.tick.isBold = false;
padlock.tick.fixLayout();
@ -3967,7 +3967,7 @@ IDE_Morph.prototype.aboutSnap = function () {
null,
null,
MorphicPreferences.isFlat ? null : new Point(1, 1),
new Color(255, 255, 255)
WHITE
),
scroller,
maxHeight = world.height() - dlg.titleFontSize * 10;
@ -6239,7 +6239,7 @@ IDE_Morph.prototype.warnAboutIE = function () {
null,
null,
MorphicPreferences.isFlat ? null : new Point(1, 1),
new Color(255, 255, 255)
WHITE
);
dlg.key = 'IE-Warning';
@ -6340,7 +6340,7 @@ ProjectDialogMorph.prototype.buildContents = function () {
null, // width
null, // font name
new Point(1, 1), // shadow offset
new Color(255, 255, 255) // shadowColor
WHITE // shadowColor
);
notification.refresh = nop;
this.srcBar.add(notification);
@ -6550,7 +6550,7 @@ ProjectDialogMorph.prototype.addSourceButton = function (
null,
null,
new Point(1, 1),
new Color(255, 255, 255)
WHITE
),
lbl2 = new StringMorph(
label,
@ -6561,7 +6561,7 @@ ProjectDialogMorph.prototype.addSourceButton = function (
null,
new Point(-1, -1),
this.titleBarColor.darker(50),
new Color(255, 255, 255)
WHITE
),
l1 = new Morph(),
l2 = new Morph(),
@ -6584,7 +6584,7 @@ ProjectDialogMorph.prototype.addSourceButton = function (
lbl2.add(new SymbolMorph(
symbol,
24,
new Color(255, 255, 255),
WHITE,
new Point(-1, -1),
this.titleBarColor.darker(50)
));
@ -7932,7 +7932,7 @@ SpriteIconMorph.uber = ToggleButtonMorph.prototype;
SpriteIconMorph.prototype.thumbSize = new Point(40, 40);
SpriteIconMorph.prototype.labelShadowOffset = null;
SpriteIconMorph.prototype.labelShadowColor = null;
SpriteIconMorph.prototype.labelColor = new Color(255, 255, 255);
SpriteIconMorph.prototype.labelColor = WHITE;
SpriteIconMorph.prototype.fontSize = 9;
// SpriteIconMorph instance creation:
@ -8376,7 +8376,7 @@ CostumeIconMorph.uber = ToggleButtonMorph.prototype;
CostumeIconMorph.prototype.thumbSize = new Point(80, 60);
CostumeIconMorph.prototype.labelShadowOffset = null;
CostumeIconMorph.prototype.labelShadowColor = null;
CostumeIconMorph.prototype.labelColor = new Color(255, 255, 255);
CostumeIconMorph.prototype.labelColor = WHITE;
CostumeIconMorph.prototype.fontSize = 9;
// CostumeIconMorph instance creation:
@ -8625,7 +8625,7 @@ TurtleIconMorph.uber = ToggleButtonMorph.prototype;
TurtleIconMorph.prototype.thumbSize = new Point(80, 60);
TurtleIconMorph.prototype.labelShadowOffset = null;
TurtleIconMorph.prototype.labelShadowColor = null;
TurtleIconMorph.prototype.labelColor = new Color(255, 255, 255);
TurtleIconMorph.prototype.labelColor = WHITE;
TurtleIconMorph.prototype.fontSize = 9;
// TurtleIconMorph instance creation:
@ -9046,7 +9046,7 @@ SoundIconMorph.uber = ToggleButtonMorph.prototype;
SoundIconMorph.prototype.thumbSize = new Point(80, 60);
SoundIconMorph.prototype.labelShadowOffset = null;
SoundIconMorph.prototype.labelShadowColor = null;
SoundIconMorph.prototype.labelColor = new Color(255, 255, 255);
SoundIconMorph.prototype.labelColor = WHITE;
SoundIconMorph.prototype.fontSize = 9;
// SoundIconMorph instance creation: