mirror of
https://github.com/devonthesofa/obsidian-note-status.git
synced 2026-07-22 12:30:24 +00:00
fix: use either icon or lucideIcon
This commit is contained in:
parent
2e7c3ad66c
commit
ecb24412aa
10 changed files with 17 additions and 1464 deletions
|
|
@ -9,6 +9,7 @@ type Props = {
|
|||
hideUnknownStatus?: boolean;
|
||||
unknownStatusConfig?: {
|
||||
icon: string;
|
||||
lucideIcon?: string;
|
||||
color: string;
|
||||
};
|
||||
iconFrameMode?: "always" | "never";
|
||||
|
|
@ -47,6 +48,7 @@ export const FileExplorerIcon: FC<Props> = memo(
|
|||
return (
|
||||
<StatusIconPreview
|
||||
icon={icon}
|
||||
lucideIcon={unknownStatusConfig?.lucideIcon}
|
||||
color={color}
|
||||
iconColorMode={iconColorMode}
|
||||
iconFrameMode={iconFrameMode}
|
||||
|
|
|
|||
|
|
@ -279,9 +279,9 @@ export const UISettings: React.FC<Props> = ({ settings, onChange }) => {
|
|||
}
|
||||
emojiPlaceholder="❓"
|
||||
emojiHint="Type any emoji or text fallback."
|
||||
lucideValue={settings.unknownStatusIcon}
|
||||
lucideValue={settings.unknownStatusLucideIcon || ""}
|
||||
onLucideChange={(value) =>
|
||||
onChange("unknownStatusIcon", value)
|
||||
onChange("unknownStatusLucideIcon", value)
|
||||
}
|
||||
lucidePlaceholder="Choose Lucide icon"
|
||||
lucideHint="Matches the Obsidian toolbar style."
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export type Props = {
|
|||
showIcon: boolean;
|
||||
showText: boolean;
|
||||
icon: string;
|
||||
lucideIcon?: string;
|
||||
color: string;
|
||||
};
|
||||
};
|
||||
|
|
@ -54,6 +55,7 @@ export const StatusBar: FC<Props> = ({
|
|||
{noStatusConfig.showIcon && (
|
||||
<StatusIcon
|
||||
icon={noStatusConfig.icon}
|
||||
lucideIcon={noStatusConfig.lucideIcon}
|
||||
size={14}
|
||||
className="status-bar-no-status-icon"
|
||||
style={{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ interface EditorToolbarButtonProps {
|
|||
onClick: () => void;
|
||||
unknownStatusConfig: {
|
||||
icon: string;
|
||||
lucideIcon?: string;
|
||||
color: string;
|
||||
};
|
||||
}
|
||||
|
|
@ -43,6 +44,7 @@ export const EditorToolbarButton: FC<EditorToolbarButtonProps> = memo(
|
|||
>
|
||||
<StatusIcon
|
||||
icon={unknownStatusConfig.icon}
|
||||
lucideIcon={unknownStatusConfig.lucideIcon}
|
||||
size={16}
|
||||
className="editor-toolbar-button__icon"
|
||||
style={{ color: unknownStatusConfig.color }}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ export const DEFAULT_PLUGIN_SETTINGS: PluginSettings = {
|
|||
quickStatusCommands: ["active", "completed"], // Add default quick commands
|
||||
// Unknown status customization
|
||||
unknownStatusIcon: "❓",
|
||||
unknownStatusLucideIcon: "",
|
||||
unknownStatusColor: "#8b949e",
|
||||
statusBarNoStatusText: "No status",
|
||||
statusBarShowNoStatusIcon: false,
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ export class FileExplorerIntegration implements IElementProcessor {
|
|||
key === "fileExplorerIconFrame" ||
|
||||
key === "fileExplorerIconColorMode" ||
|
||||
key === "unknownStatusIcon" ||
|
||||
key === "unknownStatusLucideIcon" ||
|
||||
key === "unknownStatusColor" ||
|
||||
key === "templates"
|
||||
) {
|
||||
|
|
@ -117,6 +118,7 @@ export class FileExplorerIntegration implements IElementProcessor {
|
|||
const settings = settingsService.settings;
|
||||
return {
|
||||
icon: settings.unknownStatusIcon || "❓",
|
||||
lucideIcon: settings.unknownStatusLucideIcon || "",
|
||||
color: settings.unknownStatusColor || "#8b949e",
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ export class StatusBarIntegration {
|
|||
}
|
||||
if (
|
||||
key === "unknownStatusIcon" ||
|
||||
key === "unknownStatusLucideIcon" ||
|
||||
key === "unknownStatusColor" ||
|
||||
key === "statusBarNoStatusText" ||
|
||||
key === "statusBarShowNoStatusIcon" ||
|
||||
|
|
@ -123,6 +124,7 @@ export class StatusBarIntegration {
|
|||
showIcon: settings.statusBarShowNoStatusIcon || false,
|
||||
showText: settings.statusBarShowNoStatusText ?? true,
|
||||
icon: settings.unknownStatusIcon || "❓",
|
||||
lucideIcon: settings.unknownStatusLucideIcon || "",
|
||||
color: settings.unknownStatusColor || "#8b949e",
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ export class EditorToolbarIntegration {
|
|||
}
|
||||
if (
|
||||
key === "unknownStatusIcon" ||
|
||||
key === "unknownStatusLucideIcon" ||
|
||||
key === "unknownStatusColor"
|
||||
) {
|
||||
this.renderAllButtons();
|
||||
|
|
@ -378,6 +379,7 @@ export class EditorToolbarIntegration {
|
|||
const settings = settingsService.settings;
|
||||
return {
|
||||
icon: settings.unknownStatusIcon || "❓",
|
||||
lucideIcon: settings.unknownStatusLucideIcon || "",
|
||||
color: settings.unknownStatusColor || "#8b949e",
|
||||
};
|
||||
}
|
||||
|
|
|
|||
1463
styles.css
1463
styles.css
File diff suppressed because one or more lines are too long
|
|
@ -32,6 +32,7 @@ export type PluginSettings = {
|
|||
quickStatusCommands: string[];
|
||||
// Unknown status customization
|
||||
unknownStatusIcon: string; // Custom icon for unknown status
|
||||
unknownStatusLucideIcon?: string; // Optional Lucide icon for unknown status
|
||||
unknownStatusColor: string; // Custom hex color for unknown status
|
||||
statusBarNoStatusText: string; // Custom text for status bar when no status
|
||||
statusBarShowNoStatusIcon: boolean; // Whether to show icon in status bar for no status
|
||||
|
|
|
|||
Loading…
Reference in a new issue