mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: deprecate setHighlightMode (#19211)
This commit is contained in:
committed by
Shelley Vohr
parent
4a073e4f7e
commit
825c082535
@@ -94,6 +94,17 @@ powerMonitor.querySystemIdleTime(callback)
|
||||
const idleTime = getSystemIdleTime()
|
||||
```
|
||||
|
||||
## `Tray`
|
||||
|
||||
Under macOS Catalina our former Tray implementation breaks.
|
||||
Apple's native substitute doesn't support changing the highlighting behavior.
|
||||
|
||||
```js
|
||||
// Deprecated
|
||||
tray.setHighlightMode(mode)
|
||||
// API will be removed in v7.0 without replacement.
|
||||
```
|
||||
|
||||
# Planned Breaking API Changes (5.0)
|
||||
|
||||
## `new BrowserWindow({ webPreferences })`
|
||||
|
||||
@@ -202,6 +202,8 @@ Returns `String` - the title displayed next to the tray icon in the status bar
|
||||
|
||||
Sets when the tray's icon background becomes highlighted (in blue).
|
||||
|
||||
**[Deprecated](breaking-changes.md#tray)**
|
||||
|
||||
**Note:** You can use `highlightMode` with a [`BrowserWindow`](browser-window.md)
|
||||
by toggling between `'never'` and `'always'` modes when the window visibility
|
||||
changes.
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { deprecate } = require('electron')
|
||||
const { Tray } = process.electronBinding('tray')
|
||||
|
||||
Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype)
|
||||
|
||||
// Deprecations
|
||||
Tray.prototype.setHighlightMode = deprecate.removeFunction(Tray.prototype.setHighlightMode, 'setHighlightMode')
|
||||
|
||||
module.exports = Tray
|
||||
|
||||
Reference in New Issue
Block a user