From 4823b5582feac182c6a5b1d6206d4e6943ccef99 Mon Sep 17 00:00:00 2001 From: Dave Jeffery Date: Wed, 27 Jul 2016 21:35:13 +0100 Subject: [PATCH] docs: Explain how to use highlightMode with BrowserWindow As discussed on https://github.com/electron/electron/pull/6620 --- docs/api/tray.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/api/tray.md b/docs/api/tray.md index af9243b3c6f5..95d25ba4ada8 100644 --- a/docs/api/tray.md +++ b/docs/api/tray.md @@ -193,6 +193,19 @@ Sets the title displayed aside of the tray icon in the status bar. Sets when the tray's icon background becomes highlighted (in blue). +**Note:** You can use `highlightMode` with a [`BrowserWindow`](browser-window.md) +by toggling between `'never'` and `'always'` modes when the window visibility +changes. + +```js +win.on('show', () => { + tray.setHighlightMode('always') +}) +win.on('hide', () => { + tray.setHighlightMode('never') +}) +``` + #### `tray.displayBalloon(options)` _Windows_ * `options` Object