docs: fix win.setIcon ts type (#20950)

* docs: fix win.setIcon ts type

* test: update smoke tests
This commit is contained in:
Shelley Vohr 2019-11-05 13:47:08 -08:00 committed by Samuel Attard
parent d871598d20
commit 05de7277ab
2 changed files with 14 additions and 13 deletions

View file

@ -1581,7 +1581,7 @@ Same as `webContents.showDefinitionForSelection()`.
#### `win.setIcon(icon)` _Windows_ _Linux_ #### `win.setIcon(icon)` _Windows_ _Linux_
* `icon` [NativeImage](native-image.md) * `icon` [NativeImage](native-image.md) | String
Changes window icon. Changes window icon.

View file

@ -318,17 +318,6 @@ app.setAboutPanelOptions({
version: '1.2.3' version: '1.2.3'
}) })
let window = new BrowserWindow()
window.setProgressBar(0.5)
window.setRepresentedFilename('/etc/passwd')
window.setDocumentEdited(true)
window.previewFile('/path/to/file')
window.previewFile('/path/to/file', 'Displayed Name')
window.setVibrancy('menu')
window.setVibrancy('titlebar')
window.setVibrancy('selection')
window.setVibrancy('popover')
// Online/Offline Event Detection // Online/Offline Event Detection
// https://github.com/atom/electron/blob/master/docs/tutorial/online-offline-events.md // https://github.com/atom/electron/blob/master/docs/tutorial/online-offline-events.md
@ -448,7 +437,7 @@ autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName, releaseDa
console.log('update-downloaded', releaseNotes, releaseName, releaseDate, updateURL) console.log('update-downloaded', releaseNotes, releaseName, releaseDate, updateURL)
}) })
// browser-window // BrowserWindow
// https://github.com/atom/electron/blob/master/docs/api/browser-window.md // https://github.com/atom/electron/blob/master/docs/api/browser-window.md
let win3 = new BrowserWindow({ width: 800, height: 600, show: false }) let win3 = new BrowserWindow({ width: 800, height: 600, show: false })
@ -462,6 +451,18 @@ win3.show()
const toolbarRect = document.getElementById('toolbar').getBoundingClientRect() const toolbarRect = document.getElementById('toolbar').getBoundingClientRect()
win3.setSheetOffset(toolbarRect.height) win3.setSheetOffset(toolbarRect.height)
let window = new BrowserWindow()
window.setProgressBar(0.5)
window.setRepresentedFilename('/etc/passwd')
window.setDocumentEdited(true)
window.previewFile('/path/to/file')
window.previewFile('/path/to/file', 'Displayed Name')
window.setVibrancy('menu')
window.setVibrancy('titlebar')
window.setVibrancy('selection')
window.setVibrancy('popover')
window.setIcon('/path/to/icon')
const installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron') const installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron')
// content-tracing // content-tracing