2017-01-20 1 views
1

Ive suchte überall nach, wie man die Ecken meines BrowserWindow abgerundet.Wie erstellt man abgerundete Ecken in electron browserWindow?

Wie erreiche ich abgerundete Ecken?

Ich habe versucht, es transparent zu machen. Aber nichts funktioniert.

Hers mein Code:

/** 
 
* we need to keep a global reference of the window object. If we don't, the 
 
* window will be closed automatically when the js object is garbage collected 
 
*/ 
 
let win 
 

 
function createWindow() { 
 
    // Create the browser window. 
 
    win = new BrowserWindow({ 
 
    width: 1800, 
 
    height: 1000, 
 
    frame: false, 
 
    transparent: true, 
 
    icon: __dirname + 'icon.png' 
 
    }) 
 
    
 
    // and load the index.html of the app. 
 
    win.loadURL(url.format({ 
 
    pathname: path.join(__dirname, 'index.html'), 
 
    protocol: 'file:', 
 
    slashes: true 
 
    })) 
 

 
    // Open the DevTools. 
 
    win.webContents.openDevTools() 
 

 
    // Emitted when the window is closed. 
 
    win.on('closed', function() { 
 
    /** 
 
    * Dereference the window object, usually you would store windows in an 
 
    * array if your app supports multi windows, this is the time when you 
 
    * should delete the corresponding element. 
 
    */ 
 
    win = null 
 
    }) 
 
}

+0

'Rahmen: false, Radien: [5,5,5,5]' ist das, was ich gelesen habe. – scoopzilla

+0

wo wird das hinzugefügt? @scoopzilla – WorldWideBangers

+0

@scoopzilla es funktioniert nicht – WorldWideBangers

Antwort

0
function createWindow() { 
    // Create the browser window. 
    win = new BrowserWindow({ 
     width: 1800, 
     height: 1000, 
     frame: false, 
     radii: [5,5,5,5], 
     transparent: true, 
     icon: __dirname + 'icon.png' 
}) 
+0

Das tut nichts. Ich versuche die Ecken zu runden. Es ist immer noch nicht abgerundet. – WorldWideBangers

+0

Ich muss dann etwas vermissen. Es tut uns leid :( – scoopzilla