8000 fix: macOS tray icon alternate images by trop[bot] · Pull Request #33105 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: macOS tray icon alternate images #33105

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions shell/browser/ui/tray_icon_cocoa.mm
Original file line number Diff line number Diff line change
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