Skip to content

Commit

Permalink
fix: macOS tray icon alternate images (#33104)
Browse files Browse the repository at this point in the history
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
  • Loading branch information
trop[bot] and codebytere committed Mar 2, 2022
1 parent 8519ba8 commit f757a17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shell/browser/ui/tray_icon_cocoa.mm
Expand Up @@ -93,6 +93,15 @@ - (void)setImage:(NSImage*)image {

- (void)setAlternateImage:(NSImage*)image {
[[statusItem_ button] setAlternateImage:image];

// We need to change the button type here because the default button type for
// NSStatusItem, NSStatusBarButton, does not display alternate content when
// clicked. NSButtonTypeMomentaryChange displays its alternate content when
// clicked and returns to its normal content when the user releases it, which
// is the behavior users would expect when clicking a button with an alternate
// image set.
[[statusItem_ button] setButtonType:NSButtonTypeMomentaryChange];
[self updateDimensions];
}

- (void)setIgnoreDoubleClickEvents:(BOOL)ignore {
Expand Down

0 comments on commit f757a17

Please sign in to comment.