kopia lustrzana https://github.com/backface/turtlestitch
new “visible stepping” toggle button in the control bar
rodzic
49cf6d7eac
commit
211ae93c62
54
gui.js
54
gui.js
|
@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.gui = '2017-September-21';
|
||||
modules.gui = '2017-September-25';
|
||||
|
||||
// Declarations
|
||||
|
||||
|
@ -251,6 +251,8 @@ IDE_Morph.prototype.init = function (isAutoFill) {
|
|||
this.paletteWidth = 200; // initially same as logo width
|
||||
this.stageRatio = 1; // for IDE animations, e.g. when zooming
|
||||
|
||||
this.wasSingleStepping = false; // for toggling to and from app mode
|
||||
|
||||
this.loadNewProject = false; // flag when starting up translated
|
||||
this.shield = null;
|
||||
|
||||
|
@ -576,6 +578,7 @@ IDE_Morph.prototype.createControlBar = function () {
|
|||
settingsButton,
|
||||
stageSizeButton,
|
||||
appModeButton,
|
||||
steppingButton,
|
||||
cloudButton,
|
||||
x,
|
||||
colors = [
|
||||
|
@ -661,6 +664,39 @@ IDE_Morph.prototype.createControlBar = function () {
|
|||
this.controlBar.add(appModeButton);
|
||||
this.controlBar.appModeButton = appModeButton; // for refreshing
|
||||
|
||||
//steppingButton
|
||||
button = new ToggleButtonMorph(
|
||||
null, //colors,
|
||||
myself, // the IDE is the target
|
||||
'toggleSingleStepping',
|
||||
[
|
||||
new SymbolMorph('footprints', 16),
|
||||
new SymbolMorph('footprints', 16)
|
||||
],
|
||||
function () { // query
|
||||
return Process.prototype.enableSingleStepping;
|
||||
}
|
||||
);
|
||||
|
||||
button.corner = 12;
|
||||
button.color = colors[0];
|
||||
button.highlightColor = colors[1];
|
||||
button.pressColor = new Color(153, 255, 213);
|
||||
// button.pressColor = colors[2];
|
||||
button.labelMinExtent = new Point(36, 18);
|
||||
button.padding = 0;
|
||||
button.labelShadowOffset = new Point(-1, -1);
|
||||
button.labelShadowColor = colors[1];
|
||||
button.labelColor = this.buttonLabelColor;
|
||||
button.contrast = this.buttonContrast;
|
||||
button.drawNew();
|
||||
button.hint = 'Visible stepping';
|
||||
button.fixLayout();
|
||||
button.refresh();
|
||||
steppingButton = button;
|
||||
this.controlBar.add(steppingButton);
|
||||
this.controlBar.steppingButton = steppingButton; // for refreshing
|
||||
|
||||
// stopButton
|
||||
button = new ToggleButtonMorph(
|
||||
null, // colors
|
||||
|
@ -763,7 +799,9 @@ IDE_Morph.prototype.createControlBar = function () {
|
|||
Process.prototype.flashTime = (num - 1) / 100;
|
||||
myself.controlBar.refreshResumeSymbol();
|
||||
};
|
||||
slider.alpha = MorphicPreferences.isFlat ? 0.1 : 0.3;
|
||||
// slider.alpha = MorphicPreferences.isFlat ? 0.1 : 0.3;
|
||||
slider.color = new Color(153, 255, 213);
|
||||
slider.alpha = 0.3;
|
||||
slider.setExtent(new Point(50, 14));
|
||||
this.controlBar.add(slider);
|
||||
this.controlBar.steppingSlider = slider;
|
||||
|
@ -867,6 +905,9 @@ IDE_Morph.prototype.createControlBar = function () {
|
|||
slider.setCenter(myself.controlBar.center());
|
||||
slider.setRight(stageSizeButton.left() - padding);
|
||||
|
||||
steppingButton.setCenter(myself.controlBar.center());
|
||||
steppingButton.setRight(slider.left() - padding);
|
||||
|
||||
settingsButton.setCenter(myself.controlBar.center());
|
||||
settingsButton.setLeft(this.left());
|
||||
|
||||
|
@ -1935,6 +1976,7 @@ IDE_Morph.prototype.toggleVariableFrameRate = function () {
|
|||
|
||||
IDE_Morph.prototype.toggleSingleStepping = function () {
|
||||
this.stage.threads.toggleSingleStepping();
|
||||
this.controlBar.steppingButton.refresh();
|
||||
this.controlBar.refreshSlider();
|
||||
};
|
||||
|
||||
|
@ -4502,6 +4544,7 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
|||
this.controlBar.cloudButton,
|
||||
this.controlBar.projectButton,
|
||||
this.controlBar.settingsButton,
|
||||
this.controlBar.steppingButton,
|
||||
this.controlBar.stageSizeButton,
|
||||
this.paletteHandle,
|
||||
this.stageHandle,
|
||||
|
@ -4517,6 +4560,10 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
|||
|
||||
Morph.prototype.trackChanges = false;
|
||||
if (this.isAppMode) {
|
||||
this.wasSingleStepping = Process.prototype.enableSingleStepping;
|
||||
if (this.wasSingleStepping) {
|
||||
this.toggleSingleStepping();
|
||||
}
|
||||
this.setColor(this.appModeColor);
|
||||
this.controlBar.setColor(this.color);
|
||||
this.controlBar.appModeButton.refresh();
|
||||
|
@ -4532,6 +4579,9 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
|
|||
world.keyboardReceiver.stopEditing();
|
||||
}
|
||||
} else {
|
||||
if (this.wasSingleStepping && !Process.prototype.enableSingleStepping) {
|
||||
this.toggleSingleStepping();
|
||||
}
|
||||
this.setColor(this.backgroundColor);
|
||||
this.controlBar.setColor(this.frameColor);
|
||||
elements.forEach(function (e) {
|
||||
|
|
|
@ -3644,6 +3644,10 @@ Fixes:
|
|||
------
|
||||
* GUI, Objects: added floating search button to search palette to take the user back
|
||||
|
||||
170925
|
||||
------
|
||||
* GUI, Symbols: added “visible stepping” toggle button to the control bar
|
||||
|
||||
|
||||
v4.1 Features:
|
||||
* polymorphic sprite-local custom blocks
|
||||
|
@ -3663,6 +3667,7 @@ v4.1 Features:
|
|||
* clones share their original sprite’s scripts, not a shallow-copy of them
|
||||
* a highlight-colored balloon indicates the number of active processes per shared script
|
||||
* new musical “notes” symbol
|
||||
* new “visible stepping” toggle button in the control bar
|
||||
* turn on the “Inheritance support” setting per default
|
||||
* Assert data types to list operations for more meaningful error messages
|
||||
* programmatically hide and show primitives in the palette
|
||||
|
|
Ładowanie…
Reference in New Issue