Electron customizes a window with no borders and shadows (as shown above), and encountered two difficulties during the development process:
- How to add shadow to borderless
- How to implement a custom title bar (maximize, minimize, close, drag, double-click)
- Set transparent: true, isMaximized() always returns false
Record the solution below:
let win = new BrowserWindow({
width:440,
height:450,
frame: false,
transparent: true,
webPreferences: {
devTools:false,
nodeIntegration: true,
webviewTag: true
}
})
<div class="content">
<custom-header></custom-header>
<div class="config-page">