-
Notifications
You must be signed in to change notification settings - Fork 17k
Closed
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
The WebContentsView in Electron currently only supports rectangular corners. Allowing customizable rounded corners would enable more flexible, modern designs for Electron apps.
Proposed Solution
Add a new method to the WebContentsView to set the corner radius:
const { BaseWindow, WebContentsView } = require('electron')
const win = new BaseWindow({ width: 800, height: 400 })
const view1 = new WebContentsView()
win.contentView.addChildView(view1)
view1.webContents.loadURL('https://electronjs.org')
view1.setBounds({ x: 0, y: 0, width: 400, height: 400 })
view1.setRoundedCorners(20); // for 20pxAlternatives Considered
Add an option to WebContentsView constructor to set corner radius:
const view1 = new WebContentsView({ roundedCorners: 20 }); // for 20pxAdditional Information
No response
Reactions are currently unavailable