Open k0hacuu opened 10 months ago
Tested it, works well
Found this happened again in the updates version. May I know if there is similar?
I apologize if this is a simple question but I have absolutely no experience coding and don't know where to paste this, but I really want to fix my file color plugin. I'm on a windows if that helps at all. I see the src/plugin... in the commit. is that a reference to what you happened to name your own vault. I figured if I have to edit anything it'll be in the plugins folder. When I find the file color folder I don't see a .ts file just some json files, the css, and the javascript file and I'm completely lost where to paste that code into the script file if that's what I'm looking for.
@GuyNoirPI713 Since my coding experience is also basically non-existent take this with a grain of salt, but I got it to work by manually editing the code. In the plugins folder (where you found the .json files) you open the main.js file and Ctrl+F for 'layout-change'. That should only give you one result and point you in the right place. Then you can edit the code based on the difference as seen here:
https://github.com/ecustic/obsidian-file-color/pull/26/files
Hope that helps. :)
Simple Fix for switching Workplaces
I started using this plugin recently and really liked how it looked. I also wanted to use the homepage plugin with workspaces but found that when switching to different workspaces the colors go away. This is the issue described in #21 and #7 I've never used javascript before but wanted to see if I could do something. I noticed when I change a color on the palette in settings after switching to a different workspace the colors worked again.
Code
I looked in
src/modules/SettingsPanel/index.tsx
and saw that when saving,plugin.saveSettings()
andplugin.generateColorStyles()
were being run. I added these to the layout change event and everything works. I then realised the settings don't need (and should not be) saved when the workplace switches, and just usinggenerateColorStyles()
was enough.Changes:
I added
this.generateColorStyles()
tothis.app.workspace.on('layout-change', ...)
event.Compatibility
Tested with the homepage plugin and the workspace plus plugin. Tested using below folder structure with
Cascade Colors
andColor Background
turned on.This is my first pull request, any feedback is appreciated :smile: