Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add system tray icon, keep app running when closed #58

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

marekvospel
Copy link
Contributor

@marekvospel marekvospel commented Jan 21, 2023

This pull request adds a system tray and the common behavior of applications not stopping when closed with the option to reopen it inside the system tray.

Related

elk-zone/elk#1414

@stackblitz
Copy link

stackblitz bot commented Jan 21, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@marekvospel
Copy link
Contributor Author

It seems there was a WindowBuilder::with_config method, but it seems to have been removed 😕

For the minimize to tray disabling some UI might need to be added to elk upstream repository, which I'm not sure I can do, as I'm not that familiar with it's source & tauri in general (the APIs for communication between frontend and the tauri application)

@marekvospel marekvospel marked this pull request as ready for review January 24, 2023 23:53
@marekvospel
Copy link
Contributor Author

As mentioned in the Elk discord server

If the initial value is true, min: Some(Bool(true)) gets printed, when I change it to false from the frontend, eventhough the file & the UI on the frontend changed, I still get min: Some(Bool(true)).

If the initial value is false, I get min: Some(Bool(false)) and after changing it from the frontend to true, the correct min: Some(Bool(true)) (also in the file). But now after I change it to false again, everything updates, except for the returned value from store, which stays min: Some(Bool(true))

Basically changing false -> true works, changing true -> false doesn't

               let stores = app.state::<StoreCollection<Wry>>();
               let mut path = app.path_resolver().app_data_dir().unwrap();
               path.push("settings.json");

               with_store(app.clone(), stores, path, |store| {
                   println!("min: {:?}", store.get("minimize_to_tray"));
                   let result = match store.get("minimize_to_tray") {
                       Some(serde_json::Value::Bool(value)) => value,
                       _ => &true,
                  };
               })

https://discord.com/channels/1044887051155292200/1050490177304408074/1067554891049996398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant