Get the "native" window background color for modal window


#1

I’ve created a great-looking custom “modal dialog” using a standard

myWindow = new BrowserWindow({
    width: 510,
    height: 400,
    parent: mainWindow,
    modal: true,
})

and HTML. However it doesn’t feel “native” mostly due to the background color and button styling.

Is there a way to tap into the native styling for these? Ie, how does dialog.showMessageBox
style its goods, and can I use those methods?


#2

Nope you can’t tap into the native styling, Electron only provides access to some system colors on Windows via the systemPreferences module. The dialog module uses built-in dialogs provided by the native platform APIs (at least that’s the case on Windows, I assume MacOS and Linux are similar). If you want to emulate the native look take a look at the styling in React Desktop.

IMHO even if you make the UI look native, it’s probably not going to behave 100% native, which may end up annoying users more than a non-native looking UI would.


#3

Darn. That’s too bad to hear. React Desktop looks interesting, but leaves out Ubuntu / Linux…


#4

Good crossplatform UI is just superior to native.