From f2574397fa00a7879602fab608c7f3c4da9f75f9 Mon Sep 17 00:00:00 2001 From: mgmeyers Date: Sat, 14 Oct 2023 12:48:32 -0700 Subject: [PATCH] Fixes #39 --- src/settings.ts | 13 ++++++++++++- styles.css | 21 +++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 77df5f0..4825448 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -176,7 +176,7 @@ export function buildSetting( }); // Icon select menu - new ButtonComponent(inputContainer).then((btn) => { + const iconBtn = new ButtonComponent(inputContainer).then((btn) => { if (callout.icon) { btn.setIcon(callout.icon); } else { @@ -195,6 +195,17 @@ export function buildSetting( }); }); + new ButtonComponent(inputContainer).then((btn) => { + btn.setButtonText("Clear Icon"); + btn.onClick(() => { + delete plugin.settings[index].icon; + iconBtn.buttonEl.empty(); + iconBtn.setButtonText("Set Icon"); + plugin.saveSettings(); + buildSettingCallout(calloutContainer, plugin.settings[index]); + }); + }); + // Color selection. if (callout.custom) { const [r, g, b] = callout.color diff --git a/styles.css b/styles.css index 585dd57..a8b9067 100644 --- a/styles.css +++ b/styles.css @@ -3,7 +3,7 @@ name: List Callouts id: list-callouts settings: - - + - id: lc-bg-top title: "Callout Padding: Top" type: variable-number-slider @@ -12,7 +12,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-right title: "Callout Padding: Right" type: variable-number-slider @@ -21,7 +21,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-bottom title: "Callout Padding: Bottom" type: variable-number-slider @@ -30,7 +30,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-left title: "Callout Padding: Left" type: variable-number-slider @@ -39,7 +39,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-left-checkbox-lp title: "Callout Padding: Left (live preview checkbox)" type: variable-number-slider @@ -48,7 +48,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-left-checkbox title: "Callout Padding: Left (source checkbox)" type: variable-number-slider @@ -57,7 +57,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-top-reading title: "Callout Padding: Top (reading mode)" type: variable-number-slider @@ -66,7 +66,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-right-reading title: "Callout Padding: Right (reading mode)" type: variable-number-slider @@ -75,7 +75,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-bottom-reading title: "Callout Padding: Bottom (reading mode)" type: variable-number-slider @@ -84,7 +84,7 @@ settings: min: 0 max: 60 step: 1 - - + - id: lc-bg-left-reading title: "Callout Padding: Left (reading mode)" type: variable-number-slider @@ -144,6 +144,7 @@ settings: font-family: var(--font-monospace); font-weight: bold; color: rgb(var(--lc-callout-color)); + pointer-events: none; } .lc-list-marker > svg {