added indented sub-preferences to the settings menu

snap7
jmoenig 2021-11-24 12:06:47 +01:00
rodzic a74c7a3bd6
commit 11573cb86b
1 zmienionych plików z 17 dodań i 3 usunięć

Wyświetl plik

@ -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,