Option to disable folder highlighting

This commit is contained in:
Lost Paul 2024-06-02 14:36:07 +02:00
parent a975b85469
commit 3673e6c0e2
4 changed files with 22 additions and 2 deletions

View file

@ -44,6 +44,7 @@ export default class FolderNotesPlugin extends Plugin {
if (this.settings.underlineFolderInPath) { document.body.classList.add('folder-note-underline-path'); }
if (this.settings.stopWhitespaceCollapsing) { document.body.classList.add('fn-whitespace-stop-collapsing'); }
if (this.settings.hideCollapsingIcon) { document.body.classList.add('fn-hide-collapse-icon'); }
if (!this.settings.highlightFolder) { document.body.classList.add('disable-folder-highlight'); }
new Commands(this.app, this).registerCommands();

View file

@ -99,6 +99,23 @@ export async function renderFileExplorer(settingsTab: SettingsTab) {
settingsTab.settingsPage.createEl('h3', { text: 'Style settings' });
new Setting(containerEl)
.setName('Highlight folder in the file explorer')
.setDesc('Highlight the folder name in the file explorer when you click on a folder that has a folder note')
.addToggle((toggle) =>
toggle
.setValue(settingsTab.plugin.settings.highlightFolder)
.onChange(async (value) => {
settingsTab.plugin.settings.highlightFolder = value;
if (!value) {
document.body.classList.add('disable-folder-highlight');
} else {
document.body.classList.remove('disable-folder-highlight');
}
await settingsTab.plugin.saveSettings();
})
);
new Setting(containerEl)
.setName('Hide collapse icon')
.setDesc('Hide the collapse icon in the file explorer next to the name of a folder when a folder only contains a folder note')

View file

@ -65,6 +65,7 @@ export interface FolderNotesSettings {
mobile: boolean;
desktop: boolean;
}
highlightFolder: boolean;
}
export const DEFAULT_SETTINGS: FolderNotesSettings = {
@ -160,7 +161,8 @@ export const DEFAULT_SETTINGS: FolderNotesSettings = {
openSidebar: {
mobile: false,
desktop: true,
}
},
highlightFolder: true,
};
export class SettingsTab extends PluginSettingTab {

View file

@ -15,7 +15,7 @@
}
body:not(.is-grabbing) .tree-item-self.fn-is-active:hover,
.tree-item-self.fn-is-active {
body:not(.disable-folder-highlight) .tree-item-self.fn-is-active {
color: var(--nav-item-color-active);
background-color: var(--nav-item-background-active);
font-weight: var(--nav-item-weight-active);