跳转到主内容

自定义窗口

BrowserWindow模块是您的Electron应用程序的基础,并且它暴露了需要可以改变您浏览器窗口的外观和行为的API。 本节介绍如何在macOS、 Windows和Linux上实现窗口定制的各种使用案例。

info

BrowserWindow is a subclass of the BaseWindow module. Both modules allow you to create and manage application windows in Electron, with the main difference being that BrowserWindow supports a single, full size web view while BaseWindow supports composing many web views. BaseWindow can be used interchangeably with BrowserWindow in the examples of the documents in this section.

📄️ Custom Title Bar

Application windows have a default chrome applied by the OS. Not to be confused with the Google Chrome browser, window _chrome_ refers to the parts of the window (e.g. title bar, toolbars, controls) that are not a part of the main web content. While the default title bar provided by the OS chrome is sufficent for simple use cases, many applications opt to remove it. Implementing a custom title bar can help your application feel more modern and consistent across platforms.