New feature - minimal stage mode (shift-click on small-stage button)

pull/3/merge
jmoenig 2014-10-02 10:31:09 +02:00
rodzic ba58b0e5b6
commit 45e1f3193b
2 zmienionych plików z 32 dodań i 14 usunięć

38
gui.js
Wyświetl plik

@ -69,7 +69,7 @@ SpeechBubbleMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.gui = '2014-October-01'; modules.gui = '2014-October-02';
// Declarations // Declarations
@ -703,9 +703,11 @@ IDE_Morph.prototype.createControlBar = function () {
} }
); );
x = myself.right() - (StageMorph.prototype.dimensions.x x = Math.min(
* (myself.isSmallStage ? myself.stageRatio : 1)); startButton.left() - (3 * padding + 2 * stageSizeButton.width()),
myself.right() - StageMorph.prototype.dimensions.x *
(myself.isSmallStage ? myself.stageRatio : 1)
);
[stageSizeButton, appModeButton].forEach( [stageSizeButton, appModeButton].forEach(
function (button) { function (button) {
x += padding; x += padding;
@ -3326,15 +3328,20 @@ IDE_Morph.prototype.toggleAppMode = function (appMode) {
IDE_Morph.prototype.toggleStageSize = function (isSmall) { IDE_Morph.prototype.toggleStageSize = function (isSmall) {
var myself = this, var myself = this,
world = this.world(); smallRatio = 0.5,
world = this.world(),
shiftClicked = (world.currentKey === 16);
function toggle() {
myself.isSmallStage = isNil(isSmall) ? !myself.isSmallStage : isSmall;
}
function zoomIn() { function zoomIn() {
myself.stageRatio = 1;
myself.step = function () { myself.step = function () {
myself.stageRatio -= (myself.stageRatio - 0.5) / 2; myself.stageRatio -= (myself.stageRatio - smallRatio) / 2;
myself.setExtent(world.extent()); myself.setExtent(world.extent());
if (myself.stageRatio < 0.6) { if (myself.stageRatio < (smallRatio + 0.1)) {
myself.stageRatio = 0.5; myself.stageRatio = smallRatio;
myself.setExtent(world.extent()); myself.setExtent(world.extent());
delete myself.step; delete myself.step;
} }
@ -3343,7 +3350,6 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall) {
function zoomOut() { function zoomOut() {
myself.isSmallStage = true; myself.isSmallStage = true;
myself.stageRatio = 0.5;
myself.step = function () { myself.step = function () {
myself.stageRatio += (1 - myself.stageRatio) / 2; myself.stageRatio += (1 - myself.stageRatio) / 2;
myself.setExtent(world.extent()); myself.setExtent(world.extent());
@ -3356,7 +3362,15 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall) {
}; };
} }
this.isSmallStage = isNil(isSmall) ? !this.isSmallStage : isSmall; if (shiftClicked) {
smallRatio = SpriteIconMorph.prototype.thumbSize.x * 3 /
this.stage.dimensions.x;
if (!this.isSmallStage || (smallRatio === this.stageRatio)) {
toggle();
}
} else {
toggle();
}
if (this.isAnimating) { if (this.isAnimating) {
if (this.isSmallStage) { if (this.isSmallStage) {
zoomIn(); zoomIn();
@ -3364,7 +3378,7 @@ IDE_Morph.prototype.toggleStageSize = function (isSmall) {
zoomOut(); zoomOut();
} }
} else { } else {
if (this.isSmallStage) {this.stageRatio = 0.5; } if (this.isSmallStage) {this.stageRatio = smallRatio; }
this.setExtent(world.extent()); this.setExtent(world.extent());
} }
}; };

Wyświetl plik

@ -2291,9 +2291,13 @@ ______
* Objects: fixed #378 (disable context menus for boolean representations) * Objects: fixed #378 (disable context menus for boolean representations)
* Blocks: fixed #584 * Blocks: fixed #584
140930 141001
------ ------
* Threads: workaround for some REPORT issues * Threads: workaround for some REPORT issues
* Objects: fixed #599 (disable IDE keyboard shortcuts in presentation mode) * Objects: fixed #599 (disable IDE keyboard shortcuts in presentation mode)
* Objects: correctly display symbol for %obj type input slots in the prototype template * Blocks: correctly display symbol for %obj type input slots in the prototype template
* Portuguese translation update, thanks, Manuel! * Portuguese translation update, thanks, Manuel!
141002
------
* GUI: New feature - minimal stage mode (shift-click on small-stage button)