mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Option to disable folder highlighting
This commit is contained in:
parent
a975b85469
commit
3673e6c0e2
4 changed files with 22 additions and 2 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue