docs: fix win.setIcon ts type (#20950)
* docs: fix win.setIcon ts type * test: update smoke tests
This commit is contained in:
parent
d871598d20
commit
05de7277ab
2 changed files with 14 additions and 13 deletions
|
@ -1581,7 +1581,7 @@ Same as `webContents.showDefinitionForSelection()`.
|
|||
|
||||
#### `win.setIcon(icon)` _Windows_ _Linux_
|
||||
|
||||
* `icon` [NativeImage](native-image.md)
|
||||
* `icon` [NativeImage](native-image.md) | String
|
||||
|
||||
Changes window icon.
|
||||
|
||||
|
|
|
@ -318,17 +318,6 @@ app.setAboutPanelOptions({
|
|||
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
|
||||
// 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)
|
||||
})
|
||||
|
||||
// browser-window
|
||||
// BrowserWindow
|
||||
// https://github.com/atom/electron/blob/master/docs/api/browser-window.md
|
||||
|
||||
let win3 = new BrowserWindow({ width: 800, height: 600, show: false })
|
||||
|
@ -462,6 +451,18 @@ win3.show()
|
|||
const toolbarRect = document.getElementById('toolbar').getBoundingClientRect()
|
||||
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')
|
||||
|
||||
// content-tracing
|
||||
|
|
Loading…
Reference in a new issue