From d395262861894ee6f37e31fb6d6a3b49f2969ea4 Mon Sep 17 00:00:00 2001 From: wz <44930227+wenlzhang@users.noreply.github.com> Date: Sat, 4 Nov 2023 23:12:10 +0100 Subject: [PATCH] Adjust cycling commands location in settings --- src/taskmarker-SettingsTab.ts | 58 ++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/src/taskmarker-SettingsTab.ts b/src/taskmarker-SettingsTab.ts index 10c11aa..9e9a8f0 100644 --- a/src/taskmarker-SettingsTab.ts +++ b/src/taskmarker-SettingsTab.ts @@ -318,6 +318,22 @@ export class TaskMarkerSettingsTab extends PluginSettingTab { await this.plugin.saveSettings(); }) ); + + new Setting(this.containerEl) + .setName("Support cycling task reversely (main)") + .setDesc( + "Default disabled. If enabled, a command would be added to cycle reversely among the statuses as specified above." + ) + .addToggle((toggle) => + toggle + .setValue(tempSettings.supportCyclingTasksReversely) + .onChange(async (value) => { + tempSettings.supportCyclingTasksReversely = value; + this.taskMarker.updateSettings(tempSettings); + await this.plugin.saveSettings(); + }) + ); + new Setting(this.containerEl) .setName("Cycled task (list 1)") .setDesc( @@ -364,21 +380,6 @@ export class TaskMarkerSettingsTab extends PluginSettingTab { }) ); - new Setting(this.containerEl) - .setName("Support cycling task status reversely") - .setDesc( - "Default disabled. If enabled, a command would be added to cycle reversely among the statuses as specified above." - ) - .addToggle((toggle) => - toggle - .setValue(tempSettings.supportCyclingTasksReversely) - .onChange(async (value) => { - tempSettings.supportCyclingTasksReversely = value; - this.taskMarker.updateSettings(tempSettings); - await this.plugin.saveSettings(); - }) - ); - this.containerEl.createEl("h2", { text: "Append text" }); // this.containerEl.createEl("p", { @@ -638,59 +639,60 @@ export class TaskMarkerSettingsTab extends PluginSettingTab { await this.plugin.saveSettings(); }) ); + new Setting(this.containerEl) - .setName("Add menu item for cycling a task (list 1)") + .setName("Add menu item for cycling a task reversely (main)") .setDesc( "This menu item will work in a way as specified in the section \"Cycle tasks\"." ) .addToggle((toggle) => toggle - .setValue(tempSettings.rightClickCycleList1) + .setValue(tempSettings.rightClickCycleReversely) .onChange(async (value) => { - tempSettings.rightClickCycleList1 = value; + tempSettings.rightClickCycleReversely = value; this.taskMarker.updateSettings(tempSettings); await this.plugin.saveSettings(); }) ); + new Setting(this.containerEl) - .setName("Add menu item for cycling a task (list 2)") + .setName("Add menu item for cycling a task (list 1)") .setDesc( "This menu item will work in a way as specified in the section \"Cycle tasks\"." ) .addToggle((toggle) => toggle - .setValue(tempSettings.rightClickCycleList2) + .setValue(tempSettings.rightClickCycleList1) .onChange(async (value) => { - tempSettings.rightClickCycleList2 = value; + tempSettings.rightClickCycleList1 = value; this.taskMarker.updateSettings(tempSettings); await this.plugin.saveSettings(); }) ); new Setting(this.containerEl) - .setName("Add menu item for cycling a task (list 3)") + .setName("Add menu item for cycling a task (list 2)") .setDesc( "This menu item will work in a way as specified in the section \"Cycle tasks\"." ) .addToggle((toggle) => toggle - .setValue(tempSettings.rightClickCycleList3) + .setValue(tempSettings.rightClickCycleList2) .onChange(async (value) => { - tempSettings.rightClickCycleList3 = value; + tempSettings.rightClickCycleList2 = value; this.taskMarker.updateSettings(tempSettings); await this.plugin.saveSettings(); }) ); - new Setting(this.containerEl) - .setName("Add menu item for cycling a task reversely") + .setName("Add menu item for cycling a task (list 3)") .setDesc( "This menu item will work in a way as specified in the section \"Cycle tasks\"." ) .addToggle((toggle) => toggle - .setValue(tempSettings.rightClickCycleReversely) + .setValue(tempSettings.rightClickCycleList3) .onChange(async (value) => { - tempSettings.rightClickCycleReversely = value; + tempSettings.rightClickCycleList3 = value; this.taskMarker.updateSettings(tempSettings); await this.plugin.saveSettings(); })