Skip to content

Add update-available badge to system tray icon#47030

Open
niels9001 wants to merge 6 commits intomainfrom
nielslaute/tray-update-badge
Open

Add update-available badge to system tray icon#47030
niels9001 wants to merge 6 commits intomainfrom
nielslaute/tray-update-badge

Conversation

@niels9001
Copy link
Copy Markdown
Collaborator

@niels9001 niels9001 commented Apr 15, 2026

When an update is available (readyToDownload or readyToInstall), the tray icon switches to a badged variant with an orange dot. Works for both default mode (color icon.ico) and theme-adaptive mode (light/dark variants).

Changes

Tray icon update badge

  • Add 3 badged icon variants
  • Extend get_icon() to select badged variant based on update_available state
  • Add set_tray_icon_update_available() for runtime icon switching
  • Hook into UpdateUtils.cpp state transitions via dispatch_run_on_main_ui_thread
  • Check UpdateState at startup to show badge immediately if update pending
  • Add 'Update available' context menu item at top of tray menu when active

Fix: update icons not deployed (bug fix)

  • Add APPICON_UPDATE icon resource to runner.base.rc (iconUpdate.ico was missing)
  • Add CopyFileToFolders entries for iconUpdate.ico, PowerToysDarkUpdate.ico, and PowerToysWhiteUpdate.ico in runner.vcxproj
  • Add all update icon files to installer Core.wxs so they ship in releases

UX improvements

  • 'Update available' tray menu item now navigates to General page (Overview) instead of opening Settings to Dashboard
  • Update InfoBar severity changed from Success/Informational to Warning across GeneralPage, LaunchPage, and CheckUpdateControl
  • Dashboard update badge gradient and icon refreshed (orange theme, exclamation glyph)
  • AccentButtonStyle applied to 'Install Now' button
  • Fixed casing: 'Update Available' to 'Update available'
  • Added UpdateAvailableInfoBar.Title resource string
  • Add orange update dot to the General navview item

Screenshots

Before:
image

After:

image image image image image image image image image

How to test

Since local dev builds use version 0.0.1 which blocks update checks, you need to temporarily fake an older version:

  1. In src/Version.props, change <Version>0.0.1</Version> to <Version>0.87.0</Version>
  2. Optionally, in src/runner/UpdateUtils.cpp, change both interval constants to 1 (minute) for faster testing:
    constexpr int64_t UPDATE_CHECK_INTERVAL_MINUTES = 1;
    constexpr int64_t UPDATE_CHECK_AFTER_FAILED_INTERVAL_MINUTES = 1;
  3. Build and run the runner
  4. Within ~1 minute (with the interval change) or after clicking 'Check for updates' in Settings > General, the runner will query GitHub and find a newer version

Verify

  • Tray icon changes to the update variant (badged with orange dot)
  • Right-clicking the tray icon shows 'Update available' at the top of the context menu
  • Clicking 'Update available' opens Settings directly to the General page
  • Settings General page shows the update InfoBar with Warning severity
  • Dashboard shows the update badge with orange gradient and exclamation icon
  • Quick Access flyout shows update InfoBar with Warning severity

Remember to revert Version.props and UpdateUtils.cpp before committing!

When an update is available (readyToDownload or readyToInstall), the tray icon
switches to a badged variant with an orange dot. Works for both default mode
(color icon.ico) and theme-adaptive mode (light/dark variants).

Changes:
- Add 3 badged icon variants (placeholder assets, to be replaced with designs)
- Extend get_icon() to select badged variant based on update_available state
- Add set_tray_icon_update_available() for runtime icon switching
- Hook into UpdateUtils.cpp state transitions via dispatch_run_on_main_ui_thread
- Check UpdateState at startup to show badge immediately if update pending
- Add 'Update available' context menu item at top of tray menu when active

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001 niels9001 force-pushed the nielslaute/tray-update-badge branch from cb870e8 to 3550af5 Compare April 15, 2026 15:02
niels9001 and others added 2 commits April 16, 2026 11:13
…click

- Add APPICON_UPDATE icon resource to runner.base.rc (iconUpdate.ico)
- Add CopyFileToFolders entries for all update icon variants
  (iconUpdate.ico, PowerToysDarkUpdate.ico, PowerToysWhiteUpdate.ico)
  to runner.vcxproj so they are copied to the build output
- Add update icon files to installer Core.wxs
- Change 'Update available' tray menu item to navigate to General page
  (Overview) instead of opening Settings to the default Dashboard

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Change update InfoBar severity from Success/Informational to Warning
  in GeneralPage, LaunchPage, and CheckUpdateControl
- Update gradient colors and icon glyph for update badge on Dashboard
- Add AccentButtonStyle to Install Now button
- Fix casing: 'Update Available' -> 'Update available'
- Add UpdateAvailableInfoBar.Title resource string

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001 niels9001 requested a review from a team April 16, 2026 09:14
@niels9001 niels9001 added the 0.99 label Apr 16, 2026
@niels9001 niels9001 marked this pull request as ready for review April 16, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant