fix: macOS tray icon alternate images (#33026)
This commit is contained in:
parent
1e50f7d2b6
commit
283fa2b79d
1 changed files with 9 additions and 0 deletions
|
@ -93,6 +93,15 @@
|
||||||
|
|
||||||
- (void)setAlternateImage:(NSImage*)image {
|
- (void)setAlternateImage:(NSImage*)image {
|
||||||
[[statusItem_ button] setAlternateImage: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 {
|
- (void)setIgnoreDoubleClickEvents:(BOOL)ignore {
|
||||||
|
|
Loading…
Reference in a new issue