Skip to content

Commit

Permalink
Fixes #39
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Oct 14, 2023
1 parent 1d7111a commit f257439
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
13 changes: 12 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
21 changes: 11 additions & 10 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: List Callouts
id: list-callouts
settings:
-
-
id: lc-bg-top
title: "Callout Padding: Top"
type: variable-number-slider
Expand All @@ -12,7 +12,7 @@ settings:
min: 0
max: 60
step: 1
-
-
id: lc-bg-right
title: "Callout Padding: Right"
type: variable-number-slider
Expand All @@ -21,7 +21,7 @@ settings:
min: 0
max: 60
step: 1
-
-
id: lc-bg-bottom
title: "Callout Padding: Bottom"
type: variable-number-slider
Expand All @@ -30,7 +30,7 @@ settings:
min: 0
max: 60
step: 1
-
-
id: lc-bg-left
title: "Callout Padding: Left"
type: variable-number-slider
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f257439

Please sign in to comment.