From be7598d1011d75402d0ef24259b09176d4f4bc40 Mon Sep 17 00:00:00 2001 From: ltctceplrm <14954927+ltctceplrm@users.noreply.github.com> Date: Thu, 6 Mar 2025 13:45:18 +0100 Subject: [PATCH] Changed button setup for internal consistency The buttons are now Cancel and Ok rather than Yes and No, they also have the correct order and color for the Ok button --- src/modals/ConfirmOverwriteModal.ts | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/modals/ConfirmOverwriteModal.ts b/src/modals/ConfirmOverwriteModal.ts index 501afea..bab0330 100644 --- a/src/modals/ConfirmOverwriteModal.ts +++ b/src/modals/ConfirmOverwriteModal.ts @@ -17,25 +17,23 @@ export class ConfirmOverwriteModal extends Modal { contentEl.createEl('h2', { text: 'File already exists' }); contentEl.createEl('p', { text: `The file "${this.fileName}" already exists. Do you want to overwrite it?` }); - const buttonContainer = contentEl.createDiv({ cls: 'modal-button-container' }); + contentEl.createDiv({ cls: 'media-db-plugin-spacer' }); - new Setting(buttonContainer) - .addButton(btn => { - btn.setButtonText('Yes'); - btn.onClick(() => { - this.result = true; - this.close(); - }); - btn.buttonEl.addClass('media-db-plugin-button'); - }) - .addButton(btn => { - btn.setButtonText('No'); - btn.onClick(() => { - this.result = false; - this.close(); - }); - btn.buttonEl.addClass('media-db-plugin-button'); + const bottomSettingRow = new Setting(contentEl); + bottomSettingRow.addButton(btn => { + btn.setButtonText('Cancel'); + btn.onClick(() => this.close()); + btn.buttonEl.addClass('media-db-plugin-button'); + }); + bottomSettingRow.addButton(btn => { + btn.setButtonText('Ok'); + btn.setCta(); + btn.onClick(() => { + this.result = true; + this.close(); }); + btn.buttonEl.addClass('media-db-plugin-button'); + }); } onClose() {