Option to hide collapse indicator when folder only has a folder note and nothing else

This commit is contained in:
Lost Paul 2024-01-14 12:52:28 +01:00
parent 41968bb9b8
commit 7c455e695c
5 changed files with 22 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{
"id": "folder-notes",
"name": "Folder notes",
"version": "1.7.4",
"version": "1.7.5",
"minAppVersion": "0.15.0",
"description": "Create notes within folders that can be accessed without collapsing the folder, similar to the functionality offered in Notion.",
"author": "Lost Paul",

View file

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

View file

@ -100,6 +100,23 @@ export async function renderFileExplorer(settingsTab: SettingsTab) {
settingsTab.settingsPage.createEl('h3', { text: 'Style settings' });
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')
.addToggle((toggle) =>
toggle
.setValue(settingsTab.plugin.settings.hideCollapsingIcon)
.onChange(async (value) => {
settingsTab.plugin.settings.hideCollapsingIcon = value;
await settingsTab.plugin.saveSettings();
if (value) {
document.body.classList.add('fn-hide-collapse-icon');
} else {
document.body.classList.remove('fn-hide-collapse-icon');
}
})
);
new Setting(containerEl)
.setName('Underline the name of folder notes')
.setDesc('Add an underline to folders that have a folder note in the file explorer')

View file

@ -51,6 +51,7 @@ export interface FolderNotesSettings {
openWithAlt: boolean;
excludeFolderDefaultSettings: ExcludedFolder;
excludePatternDefaultSettings: ExcludePattern;
hideCollapsingIcon: boolean;
}
export const DEFAULT_SETTINGS: FolderNotesSettings = {
@ -133,6 +134,7 @@ export const DEFAULT_SETTINGS: FolderNotesSettings = {
excludeFromFolderOverview: false,
string: '',
},
hideCollapsingIcon: false,
};
export class SettingsTab extends PluginSettingTab {

View file

@ -232,7 +232,7 @@ body:not(.is-grabbing) .tree-item-self.fn-is-active:hover,
font-style: italic;
}
.only-has-folder-note .tree-item-icon {
.fn-hide-collapse-icon .only-has-folder-note .tree-item-icon {
display: none;
}