kopia lustrzana https://github.com/backface/turtlestitch
migrated project recovery dialog
rodzic
dda20aae34
commit
b9e1d326ed
29
src/gui.js
29
src/gui.js
|
@ -7412,16 +7412,14 @@ ProjectRecoveryDialogMorph.prototype.buildContents = function () {
|
||||||
this.preview.fontSize = InputFieldMorph.prototype.fontSize;
|
this.preview.fontSize = InputFieldMorph.prototype.fontSize;
|
||||||
this.preview.typeInPadding = InputFieldMorph.prototype.typeInPadding;
|
this.preview.typeInPadding = InputFieldMorph.prototype.typeInPadding;
|
||||||
this.preview.contrast = InputFieldMorph.prototype.contrast;
|
this.preview.contrast = InputFieldMorph.prototype.contrast;
|
||||||
this.preview.drawNew = function () {
|
this.preview.render = function (ctx) {
|
||||||
InputFieldMorph.prototype.drawNew.call(this);
|
InputFieldMorph.prototype.render.call(this, ctx);
|
||||||
if (this.texture) {
|
if (this.texture) {
|
||||||
this.drawTexture(this.texture);
|
this.renderTexture(this.texture, ctx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.preview.drawCachedTexture = function () {
|
this.preview.renderCachedTexture = function (ctx) {
|
||||||
var context = this.image.getContext('2d');
|
ctx.drawImage(this.cachedTexture, this.edge, this.edge);
|
||||||
context.drawImage(this.cachedTexture, this.edge, this.edge);
|
|
||||||
this.changed();
|
|
||||||
};
|
};
|
||||||
this.preview.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
|
this.preview.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
|
||||||
this.preview.setExtent(
|
this.preview.setExtent(
|
||||||
|
@ -7429,7 +7427,6 @@ ProjectRecoveryDialogMorph.prototype.buildContents = function () {
|
||||||
);
|
);
|
||||||
|
|
||||||
this.body.add(this.preview);
|
this.body.add(this.preview);
|
||||||
this.preview.drawNew();
|
|
||||||
|
|
||||||
this.notesField = new ScrollFrameMorph();
|
this.notesField = new ScrollFrameMorph();
|
||||||
this.notesField.fixLayout = nop;
|
this.notesField.fixLayout = nop;
|
||||||
|
@ -7438,7 +7435,7 @@ ProjectRecoveryDialogMorph.prototype.buildContents = function () {
|
||||||
this.notesField.fontSize = InputFieldMorph.prototype.fontSize;
|
this.notesField.fontSize = InputFieldMorph.prototype.fontSize;
|
||||||
this.notesField.typeInPadding = InputFieldMorph.prototype.typeInPadding;
|
this.notesField.typeInPadding = InputFieldMorph.prototype.typeInPadding;
|
||||||
this.notesField.contrast = InputFieldMorph.prototype.contrast;
|
this.notesField.contrast = InputFieldMorph.prototype.contrast;
|
||||||
this.notesField.drawNew = InputFieldMorph.prototype.drawNew;
|
this.notesField.render = InputFieldMorph.prototype.render;
|
||||||
this.notesField.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
|
this.notesField.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
|
||||||
|
|
||||||
this.notesField.acceptsDrops = false;
|
this.notesField.acceptsDrops = false;
|
||||||
|
@ -7470,7 +7467,7 @@ ProjectRecoveryDialogMorph.prototype.buildListField = function () {
|
||||||
this.listField.fontSize = InputFieldMorph.prototype.fontSize;
|
this.listField.fontSize = InputFieldMorph.prototype.fontSize;
|
||||||
this.listField.typeInPadding = InputFieldMorph.prototype.typeInPadding;
|
this.listField.typeInPadding = InputFieldMorph.prototype.typeInPadding;
|
||||||
this.listField.contrast = InputFieldMorph.prototype.contrast;
|
this.listField.contrast = InputFieldMorph.prototype.contrast;
|
||||||
this.listField.drawNew = InputFieldMorph.prototype.drawNew;
|
this.listField.render = InputFieldMorph.prototype.render;
|
||||||
this.listField.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
|
this.listField.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
|
||||||
|
|
||||||
this.listField.action = function (item) {
|
this.listField.action = function (item) {
|
||||||
|
@ -7482,11 +7479,11 @@ ProjectRecoveryDialogMorph.prototype.buildListField = function () {
|
||||||
return version.lastupdated === item;
|
return version.lastupdated === item;
|
||||||
});
|
});
|
||||||
myself.notesText.text = version.notes || '';
|
myself.notesText.text = version.notes || '';
|
||||||
myself.notesText.drawNew();
|
myself.notesText.rerender();
|
||||||
myself.notesField.contents.adjustBounds();
|
myself.notesField.contents.adjustBounds();
|
||||||
myself.preview.texture = version.thumbnail;
|
myself.preview.texture = version.thumbnail;
|
||||||
myself.preview.cachedTexture = null;
|
myself.preview.cachedTexture = null;
|
||||||
myself.preview.drawNew();
|
myself.preview.rerender();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.ide.cloud.getProjectVersionMetadata(
|
this.ide.cloud.getProjectVersionMetadata(
|
||||||
|
@ -7578,10 +7575,7 @@ ProjectRecoveryDialogMorph.prototype.clearDetails =
|
||||||
|
|
||||||
ProjectRecoveryDialogMorph.prototype.fixLayout = function () {
|
ProjectRecoveryDialogMorph.prototype.fixLayout = function () {
|
||||||
var titleHeight = fontHeight(this.titleFontSize) + this.titlePadding * 2,
|
var titleHeight = fontHeight(this.titleFontSize) + this.titlePadding * 2,
|
||||||
thin = this.padding / 2,
|
thin = this.padding / 2;
|
||||||
oldFlag = Morph.prototype.trackChanges;
|
|
||||||
|
|
||||||
Morph.prototype.trackChanges = false;
|
|
||||||
|
|
||||||
if (this.body) {
|
if (this.body) {
|
||||||
this.body.setPosition(this.position().add(new Point(
|
this.body.setPosition(this.position().add(new Point(
|
||||||
|
@ -7628,9 +7622,6 @@ ProjectRecoveryDialogMorph.prototype.fixLayout = function () {
|
||||||
this.buttons.setCenter(this.center());
|
this.buttons.setCenter(this.center());
|
||||||
this.buttons.setBottom(this.bottom() - this.padding);
|
this.buttons.setBottom(this.bottom() - this.padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
Morph.prototype.trackChanges = oldFlag;
|
|
||||||
this.changed();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// LibraryImportDialogMorph ///////////////////////////////////////////
|
// LibraryImportDialogMorph ///////////////////////////////////////////
|
||||||
|
|
Ładowanie…
Reference in New Issue