Skip to content

fix(NotifyIcon): Allow changing tray icon source#409

Merged
pomianowski merged 1 commit intolepoco:developmentfrom
trungnt2910:dev/trungnt2910/NotifyIconFix
Oct 7, 2022
Merged

fix(NotifyIcon): Allow changing tray icon source#409
pomianowski merged 1 commit intolepoco:developmentfrom
trungnt2910:dev/trungnt2910/NotifyIconFix

Conversation

@trungnt2910
Copy link
Copy Markdown
Contributor

  • Properly set _notifyIconService.Icon from OnIconChanged handler in NotifyIcon.
  • Adds a new ModifyIcon function to INotifyIcon. Internally, this functions calls the Win32 Shell_NotifyIcon with the first argument being NIM_MODIFY.
  • Edits the Hicon.FromSource to allow converting the more general BitmapSource class to a Hicon.

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Issue Number: See #408

What is the new behavior?

The tray icon changes properly if the Icon property of NotifyIcon is set to a valid BitmapSource.

Other information

Should fix #408

The PR adds a new function to INotifyIcon and TrayManager to expose the Win32 functionality of modifying a ShellIcon.
The PR does not modify any public API and/or UI controls.

@github-actions github-actions Bot added the controls Changes to the appearance or logic of custom controls. label Sep 26, 2022
- Properly set `_notifyIconService.Icon` from `OnIconChanged` handler in
`NotifyIcon`.
- Adds a new `ModifyIcon` function to `INotifyIcon`. Internally, this
functions calls the Win32 `Shell_NotifyIcon` with the first argument
being `NIM_MODIFY`.
- Edits the `Hicon.FromSource` to allow converting the more general
`BitmapSource` class to a `Hicon`.
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/NotifyIconFix branch from a18cad2 to b9d347d Compare September 26, 2022 16:16
@pomianowski pomianowski merged commit 32daabb into lepoco:development Oct 7, 2022
@pomianowski pomianowski added this to the Base controls complete milestone Oct 7, 2022
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

controls Changes to the appearance or logic of custom controls.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants