简体   繁体   中英

Electron and macOS: how to customize the 'About <app>' display panel that pops up when user clicks the 'About <app>' menuItem?

When writing an Electron app, the macOS build provides an "About " menu item as the first item of the first menu 1 . When this is clicked, a small panel pops up displaying app name, version, and copyright if available 2 .

How to customize the contents rendered in the panel?

The Electron menuItem role docs only mentions:

 `about` - Map to the `orderFrontStandardAboutPanel` action.

The apple docs on orderFrontStandardAboutPanel don't provide any insight.

See screenshots, including an example of a customized display panel (via GIMP):

关于来自 macOS 电子应用程序的应用程序菜单项

关于 macOS 电子应用程序的应用程序显示面板

自定义关于 macOS 上的 gimp 显示面板

This is not nearly as pretty as what you want, but if you just want to customize the simple built-in About Panel for macOS, Electron does let you customize the text.

You simply call app.setAboutPanelOptions

  /*
    Here's how the "About" dialog is displayed: (applies to macOS only)

    <app icon>
    <applicationName>
    <applicationVersion> (<version>)
    <credits>
    <copyright>
   */
  app.setAboutPanelOptions({
    applicationName: "Name", 
    applicationVersion: "App Version",
    version: "Version",
    credits: "Credits",
    copyright: "Copyright"
  });

I use 'About This App' Window for Electron Apps lib. Simple, easy to implement.

Apparently it is possible to completely customize the content through the use_inner_html option but I haven't had a need to do that so can't speak to how well it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM