wyhaya / tauri-plugin-theme

Dynamically change Tauri App theme
46 stars 6 forks source link

Added support for Tauri v2 #2

Closed reyamir closed 7 months ago

reyamir commented 7 months ago

Changes:

I'm not sure my solution is best, but it's working in my app

wyhaya commented 7 months ago

Here are some questions:

  1. saved_theme_value should accept a file path, you are currently passing a directory.
  2. You only changed macOS and forgot about Linux and Windows.

Since tauri v2 changed the api, I recommend modifying these fn

- pub(crate) fn saved_theme_value(path: &PathBuf) -> Theme
+ pub(crate) fn saved_theme_value<R: Runtime>(app: AppHandle<R>) -> Theme 

- pub(crate) fn save_theme_value(path: &PathBuf, theme: Theme)
+ pub(crate) fn save_theme_value<R: Runtime>(app: AppHandle<R>, theme: Theme)

It will be simpler. Just some suggestions

wyhaya commented 7 months ago

Thanks, but there are still some problems, I will fix it in another commit

reyamir commented 7 months ago

oh thank you, I'm still struggling at it 😅

wyhaya commented 7 months ago

New version (0.3.0) released to crates.io