kopia lustrzana https://github.com/backface/turtlestitch
added indented sub-preferences to the settings menu
rodzic
a74c7a3bd6
commit
11573cb86b
20
src/gui.js
20
src/gui.js
|
@ -3786,6 +3786,20 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
}
|
||||
}
|
||||
|
||||
function addSubPreference(label, toggle, test, onHint, offHint, hide) {
|
||||
if (!hide || shiftClicked) {
|
||||
menu.addItem(
|
||||
[
|
||||
(test? on : off),
|
||||
' ' + localize(label)
|
||||
],
|
||||
toggle,
|
||||
test ? onHint : offHint,
|
||||
hide ? new Color(100, 0, 0) : null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
menu = new MenuMorph(this);
|
||||
menu.addPair(
|
||||
[
|
||||
|
@ -3884,7 +3898,7 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
'check to enable\ninput sliders for\nentry fields'
|
||||
);
|
||||
if (MorphicPreferences.useSliderForInput) {
|
||||
addPreference(
|
||||
addSubPreference(
|
||||
'Execute on slider change',
|
||||
'toggleSliderExecute',
|
||||
ArgMorph.prototype.executeOnSliderEdit,
|
||||
|
@ -4212,14 +4226,14 @@ IDE_Morph.prototype.settingsMenu = function () {
|
|||
false
|
||||
);
|
||||
if (this.scene.unifiedPalette) {
|
||||
addPreference(
|
||||
addSubPreference(
|
||||
'Show categories',
|
||||
() => this.toggleCategoryNames(),
|
||||
this.scene.showCategories,
|
||||
'uncheck to hide\ncategory names\nin the palette',
|
||||
'check to show\ncategory names\nin the palette'
|
||||
);
|
||||
addPreference(
|
||||
addSubPreference(
|
||||
'Show buttons',
|
||||
() => this.togglePaletteButtons(),
|
||||
this.scene.showPaletteButtons,
|
||||
|
|
Ładowanie…
Reference in New Issue