summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-10-04 16:54:16 +0200
committerjmoenig <jens@moenig.org>2013-10-04 16:54:16 +0200
commit020cac64b183ba0edc07d3e3d624390d056f542d (patch)
treedd5ae3f774f040abbcb1cbb7b4dad8b7d00d5fc8
parent4e501e00ad6185fb631d4c6851dfd5383fdc19b7 (diff)
downloadsnap-yow-020cac64b183ba0edc07d3e3d624390d056f542d.tar.gz
snap-yow-020cac64b183ba0edc07d3e3d624390d056f542d.zip
"plain block prototype labels" preference setting
hide / show the (+) symbols in the block editor
-rw-r--r--byob.js11
-rw-r--r--gui.js29
-rwxr-xr-xhistory.txt1
-rw-r--r--lang-de.js8
-rw-r--r--locale.js4
5 files changed, 46 insertions, 7 deletions
diff --git a/byob.js b/byob.js
index 004ef87..82b795d 100644
--- a/byob.js
+++ b/byob.js
@@ -105,7 +105,7 @@ CommentMorph, localize, CSlotMorph, SpeechBubbleMorph, MorphicPreferences*/
// Global stuff ////////////////////////////////////////////////////////
-modules.byob = '2013-September-18';
+modules.byob = '2013-October-04';
// Declarations
@@ -2081,6 +2081,10 @@ BlockLabelPlaceHolderMorph.prototype = new StringMorph();
BlockLabelPlaceHolderMorph.prototype.constructor = BlockLabelPlaceHolderMorph;
BlockLabelPlaceHolderMorph.uber = StringMorph.prototype;
+// BlockLabelPlaceHolderMorph preferences settings
+
+BlockLabelPlaceHolderMorph.prototype.plainLabel = false; // always show (+)
+
// BlockLabelPlaceHolderMorph instance creation:
function BlockLabelPlaceHolderMorph() {
@@ -2101,6 +2105,11 @@ BlockLabelPlaceHolderMorph.prototype.init = function () {
BlockLabelPlaceHolderMorph.prototype.drawNew = function () {
var context, width, x, y, cx, cy;
+ // set my text contents depending on the "plainLabel" flag
+ if (this.plainLabel) {
+ this.text = this.isHighlighted ? ' + ' : '';
+ }
+
// initialize my surface property
this.image = newCanvas();
context = this.image.getContext('2d');
diff --git a/gui.js b/gui.js
index b9971f2..debb0b7 100644
--- a/gui.js
+++ b/gui.js
@@ -64,11 +64,11 @@ standardSettings, Sound, BlockMorph, ToggleMorph, InputSlotDialogMorph,
ScriptsMorph, isNil, SymbolMorph, BlockExportDialogMorph,
BlockImportDialogMorph, SnapTranslator, localize, List, InputSlotMorph,
SnapCloud, Uint8Array, HandleMorph, SVG_Costume, fontHeight, hex_sha512,
-sb, CommentMorph, CommandBlockMorph*/
+sb, CommentMorph, CommandBlockMorph, BlockLabelPlaceHolderMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.gui = '2013-September-19';
+modules.gui = '2013-October-04';
// Declarations
@@ -1701,7 +1701,8 @@ IDE_Morph.prototype.applySavedSettings = function () {
zoom = this.getSetting('zoom'),
language = this.getSetting('language'),
click = this.getSetting('click'),
- longform = this.getSetting('longform');
+ longform = this.getSetting('longform'),
+ plainprototype = this.getSetting('plainprototype');
// design
if (design === 'flat') {
@@ -1733,6 +1734,11 @@ IDE_Morph.prototype.applySavedSettings = function () {
if (longform) {
InputSlotDialogMorph.prototype.isLaunchingExpanded = true;
}
+
+ // plain prototype labels
+ if (plainprototype) {
+ BlockLabelPlaceHolderMorph.prototype.plainLabel = true;
+ }
};
IDE_Morph.prototype.saveSetting = function (key, value) {
@@ -2096,6 +2102,13 @@ IDE_Morph.prototype.settingsMenu = function () {
'check to always show slot\ntypes in the input dialog'
);
addPreference(
+ 'Plain prototype labels',
+ 'togglePlainPrototypeLabels',
+ BlockLabelPlaceHolderMorph.prototype.plainLabel,
+ 'uncheck to always show (+) symbols\nin block prototype labels',
+ 'check to hide (+) symbols\nin block prototype labels'
+ );
+ addPreference(
'Virtual keyboard',
'toggleVirtualKeyboard',
MorphicPreferences.useVirtualKeyboard,
@@ -3043,6 +3056,16 @@ IDE_Morph.prototype.toggleLongFormInputDialog = function () {
}
};
+IDE_Morph.prototype.togglePlainPrototypeLabels = function () {
+ BlockLabelPlaceHolderMorph.prototype.plainLabel =
+ !BlockLabelPlaceHolderMorph.prototype.plainLabel;
+ if (BlockLabelPlaceHolderMorph.prototype.plainLabel) {
+ this.saveSetting('plainprototype', true);
+ } else {
+ this.removeSetting('plainprototype');
+ }
+};
+
IDE_Morph.prototype.togglePreferEmptySlotDrops = function () {
ScriptsMorph.prototype.isPreferringEmptySlots =
!ScriptsMorph.prototype.isPreferringEmptySlots;
diff --git a/history.txt b/history.txt
index d3b210b..00fa2c7 100755
--- a/history.txt
+++ b/history.txt
@@ -1939,3 +1939,4 @@ ______
* Threads: Type-check the SPLIT block's input before eval'ing it
* Objects: Prevent watcher cells from growing wider as their contents becomes taller
* Objects: Keep watchers onstage when hiding/showing them, fixes #195
+* BYOB, GUI, locale: New preference setting for plain block prototype labels
diff --git a/lang-de.js b/lang-de.js
index 07f0b00..dec6092 100644
--- a/lang-de.js
+++ b/lang-de.js
@@ -185,7 +185,7 @@ SnapTranslator.dict.de = {
'translator_e-mail':
'jens@moenig.org', // optional
'last_changed':
- '2013-09-16', // this, too, will appear in the Translators tab
+ '2013-10-04', // this, too, will appear in the Translators tab
// GUI
// control bar:
@@ -705,6 +705,12 @@ SnapTranslator.dict.de = {
+ 'zu erm\u00f6glichen',
'Long form input dialog':
'Ausf\u00fchrlicher Input-Dialog',
+ 'Plain prototype labels':
+ 'Einfache Prototyp-Beschriftung',
+ 'uncheck to always show (+) symbols\nin block prototype labels':
+ 'ausschalten, um (+) Zeichen\nim Blockeditor zu verbergen',
+ 'check to hide (+) symbols\nin block prototype labels':
+ 'einschalten, um (+) Zeichen\nim Blockeditor immer anzuzeigen',
'check to always show slot\ntypes in the input dialog':
'einschalten, um immer die Datentypen\nim Input-Dialog zu sehen',
'uncheck to use the input\ndialog in short form':
diff --git a/locale.js b/locale.js
index 921f678..2b032e2 100644
--- a/locale.js
+++ b/locale.js
@@ -42,7 +42,7 @@
/*global modules, contains*/
-modules.locale = '2013-August-17';
+modules.locale = '2013-October-04';
// Global stuff
@@ -149,7 +149,7 @@ SnapTranslator.dict.de = {
'translator_e-mail':
'jens@moenig.org',
'last_changed':
- '2013-09-16'
+ '2013-10-04'
};
SnapTranslator.dict.it = {