kopia lustrzana https://github.com/backface/turtlestitch
save block-transparency in settings
rodzic
d2247c364b
commit
850dbe7618
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
### 2020-07-22
|
### 2020-07-22
|
||||||
* morphic, blocks, gui: tweaked block-fading mouse-over
|
* morphic, blocks, gui: tweaked block-fading mouse-over
|
||||||
* blocks, threads: tweaked context visualizations to be alpha-independent
|
* blocks, threads: tweaked context visualizations to be alpha-independent
|
||||||
|
* gui: save block-transparency in settings
|
||||||
|
|
||||||
### 2020-07-21
|
### 2020-07-21
|
||||||
* blocks: tweaked block highlights for fade-out
|
* blocks: tweaked block highlights for fade-out
|
||||||
|
|
17
src/gui.js
17
src/gui.js
|
@ -2395,6 +2395,7 @@ IDE_Morph.prototype.refreshIDE = function () {
|
||||||
IDE_Morph.prototype.applySavedSettings = function () {
|
IDE_Morph.prototype.applySavedSettings = function () {
|
||||||
var design = this.getSetting('design'),
|
var design = this.getSetting('design'),
|
||||||
zoom = this.getSetting('zoom'),
|
zoom = this.getSetting('zoom'),
|
||||||
|
fade = this.getSetting('fade'),
|
||||||
language = this.getSetting('language'),
|
language = this.getSetting('language'),
|
||||||
click = this.getSetting('click'),
|
click = this.getSetting('click'),
|
||||||
longform = this.getSetting('longform'),
|
longform = this.getSetting('longform'),
|
||||||
|
@ -2419,6 +2420,11 @@ IDE_Morph.prototype.applySavedSettings = function () {
|
||||||
SpriteMorph.prototype.initBlocks();
|
SpriteMorph.prototype.initBlocks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// blocks fade
|
||||||
|
if (!isNil(fade)) {
|
||||||
|
this.setBlockTransparency(+fade);
|
||||||
|
}
|
||||||
|
|
||||||
// language
|
// language
|
||||||
if (language && language !== 'en') {
|
if (language && language !== 'en') {
|
||||||
this.userLanguage = language;
|
this.userLanguage = language;
|
||||||
|
@ -5680,7 +5686,7 @@ IDE_Morph.prototype.userFadeBlocks = function () {
|
||||||
|
|
||||||
dlg = new DialogBoxMorph(
|
dlg = new DialogBoxMorph(
|
||||||
null,
|
null,
|
||||||
num => this.setBlockTransparency(num)
|
num => this.setBlockTransparency(num, true) // and save setting
|
||||||
).withKey('fadeBlocks');
|
).withKey('fadeBlocks');
|
||||||
if (MorphicPreferences.isTouchDevice) {
|
if (MorphicPreferences.isTouchDevice) {
|
||||||
dlg.isDraggable = false;
|
dlg.isDraggable = false;
|
||||||
|
@ -5717,9 +5723,16 @@ IDE_Morph.prototype.userFadeBlocks = function () {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
IDE_Morph.prototype.setBlockTransparency = function (num) {
|
IDE_Morph.prototype.setBlockTransparency = function (num, save) {
|
||||||
SyntaxElementMorph.prototype.setAlphaScaled(100 - num);
|
SyntaxElementMorph.prototype.setAlphaScaled(100 - num);
|
||||||
this.changed();
|
this.changed();
|
||||||
|
if (save) {
|
||||||
|
if (num === 0) {
|
||||||
|
this.removeSetting('fade');
|
||||||
|
} else {
|
||||||
|
this.saveSetting('fade', num);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// IDE_Morph stage size manipulation
|
// IDE_Morph stage size manipulation
|
||||||
|
|
Ładowanie…
Reference in New Issue