Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fnune
Copy link
Contributor

@fnune fnune commented May 20, 2021

Draft PR to solve #64

  • Linux
  • Windows
  • macOS

Submitting this early since I have the feeling that I'm making the code
a lot uglier. I'm new to Rust in terms of actual contributions so I'd
like a first pass review to see if I'm approaching this the right way.

I decided to add an instance field to SystemTray so that it can hold
the platform-specific system tray instance, in the case of Linux that's
an AppIndicator. This is so that later on we can access that instance
during runtime and use its set_icon method.

Later on this can be extended to set_items to also solve #63

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Documentation
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes. Issue #___
  • No (I think? I now take &mut self in SystemTray::initialize)

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Draft PR to solve tauri-apps#64

- [x] Linux
- [ ] Windows
- [ ] macOS

Submitting this early since I have the feeling that I'm making the code
a lot uglier. I'm new to Rust in terms of actual contributions so I'd
like a first pass review to see if I'm approaching this the right way.

I decided to add an `instance` field to `SystemTray` so that it can hold
the platform-specific system tray instance, in the case of Linux that's
an `AppIndicator`. This is so that later on we can access that instance
during runtime and use its `set_icon` method.

Later on this can be extended to `set_items` to also solve tauri-apps#63
@fnune fnune changed the title [WIP] Implement SystemTray::set_icon to change the icon at runtime [WIP] fix #63: Add SystemTray::set_icon to change the icon at runtime May 20, 2021
@fnune
Copy link
Contributor Author

fnune commented May 20, 2021

Just looking for initial feedback. It's my first PR, so I'm sure existing maintainers will go "hell no" with some of my code.

@fnune
Copy link
Contributor Author

fnune commented May 20, 2021

The changes seem reasonably transferable to the macOS and Windows implementations.

@lemarier
Copy link
Member

Hi buddy,

I need to make some refactoring to the menu for the accelerators.
Please hold a bit I'll try to push changes ~ Monday, but you can work to get the native call to winapi and cocoa to works

Thanks!

@fnune
Copy link
Contributor Author

fnune commented May 26, 2021

Hey! Wondering if I'm safe to rebase and continue working now?

@lemarier
Copy link
Member

lemarier commented May 26, 2021

I didnt finished but you can take a look at #77

Edit: I’ll suggest to wait a bit as a complete refactoring is in progress for a cleaner codebase

@lemarier
Copy link
Member

But you can do the linux part (of the PR #77 ) if you want to help!

@lemarier
Copy link
Member

lemarier commented Jun 3, 2021

Closing in favor of #77

Thanks for your time tho we really appreciate it.

If you think there is something we should modify or expose in #77 feel free to create a new PR!

@lemarier lemarier closed this Jun 3, 2021
@fnune
Copy link
Contributor Author

fnune commented Jun 3, 2021

Thank you so much!

I'm sorry I couldn't continue with this on time.

@wusyong
Copy link
Member

wusyong commented Jun 3, 2021

@fnune Don't be sorry! This is an open-source project and it requires voluntary. It's okay that thing isn't delivered sometimes.

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.

3 participants