Перейти к основному содержанию

BaseWindowConstructorOptions Object

  • width Integer (optional) - Window's width in pixels. Default is 800.
  • height Integer (optional) - Window's height in pixels. Default is 600.
  • x Integer (optional) - (required if y is used) Window's left offset from screen. Значение по умолчанию центрирует окно.
  • y Integer (optional) - (required if x is used) Window's top offset from screen. Значение по умолчанию центрирует окно.
  • useContentSize boolean (optional) - The width and height would be used as web page's size, which means the actual window's size will include window frame's size and be slightly larger. Default is false.
  • center boolean (optional) - Show window in the center of the screen. Default is false.
  • minWidth Integer (optional) - Window's minimum width. Default is 0.
  • minHeight Integer (optional) - Window's minimum height. Default is 0.
  • maxWidth Integer (optional) - Window's maximum width. По умолчанию нет ограничения.
  • maxHeight Integer (optional) - Window's maximum height. По умолчанию нет ограничения.
  • resizable boolean (optional) - Whether window is resizable. Default is true.
  • movable boolean (optional) macOS Windows - Whether window is movable. Не реализовано в Linux. Default is true.
  • minimizable boolean (optional) macOS Windows - Whether window is minimizable. Не реализовано в Linux. Default is true.
  • maximizable boolean (optional) macOS Windows - Whether window is maximizable. Не реализовано в Linux. Default is true.
  • closable boolean (optional) macOS Windows - Whether window is closable. Не реализовано в Linux. Default is true.
  • focusable boolean (optional) - Whether the window can be focused. Default is true. On Windows setting focusable: false also implies setting skipTaskbar: true. On Linux setting focusable: false makes the window stop interacting with wm, so the window will always stay on top in all workspaces.
  • alwaysOnTop boolean (optional) - Whether the window should always stay on top of other windows. Default is false.
  • fullscreen boolean (optional) - Whether the window should show in fullscreen. When explicitly set to false the fullscreen button will be hidden or disabled on macOS. Default is false.
  • fullscreenable boolean (optional) - Whether the window can be put into fullscreen mode. On macOS, also whether the maximize/zoom button should toggle full screen mode or maximize window. Default is true.
  • simpleFullscreen boolean (optional) macOS - Use pre-Lion fullscreen on macOS. Default is false.
  • skipTaskbar boolean (optional) macOS Windows - Whether to show the window in taskbar. Default is false.
  • hiddenInMissionControl boolean (optional) macOS - Whether window should be hidden when the user toggles into mission control.
  • kiosk boolean (optional) - Whether the window is in kiosk mode. Default is false.
  • title string (optional) - Default window title. Default is "Electron". If the HTML tag <title> is defined in the HTML file loaded by loadURL(), this property will be ignored.
  • icon (NativeImage | string) (optional) - The window icon. On Windows it is recommended to use ICO icons to get best visual effects, you can also leave it undefined so the executable's icon will be used.
  • show boolean (optional) - Whether window should be shown when created. Default is true.
  • frame boolean (optional) - Specify false to create a frameless window. Default is true.
  • parent BaseWindow (optional) - Specify parent window. Default is null.
  • modal boolean (optional) - Whether this is a modal window. This only works when the window is a child window. Default is false.
  • acceptFirstMouse boolean (optional) macOS - Whether clicking an inactive window will also click through to the web contents. Default is false on macOS. This option is not configurable on other platforms.
  • disableAutoHideCursor boolean (optional) - Whether to hide cursor when typing. Default is false.
  • autoHideMenuBar boolean (optional) Linux Windows - Auto hide the menu bar unless the Alt key is pressed. Default is false.
  • enableLargerThanScreen boolean (optional) macOS - Enable the window to be resized larger than screen. Only relevant for macOS, as other OSes allow larger-than-screen windows by default. Default is false.
  • backgroundColor string (optional) - The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if transparent is set to true. Default is #FFF (white). See win.setBackgroundColor for more information.
  • hasShadow boolean (optional) - Whether window should have a shadow. Default is true.
  • opacity number (optional) macOS Windows - Set the initial opacity of the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
  • darkTheme boolean (optional) - Forces using dark theme for the window, only works on some GTK+3 desktop environments. Default is false.
  • transparent boolean (optional) - Makes the window transparent. Default is false. В Windows не работает до тех пор, пока окно не будет без фрейма. When you add a View to a BaseWindow, you'll need to call view.setBackgroundColor with a transparent background color on that view to make its background transparent as well.
  • type string (optional) - The type of window, default is normal window. See more about this below.
  • visualEffectState string (optional) macOS - Specify how the material appearance should reflect window activity state on macOS. Must be used with the vibrancy property. Возможные значения:
    • followWindow - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
    • active - The backdrop should always appear active.
    • inactive - The backdrop should always appear inactive.
  • titleBarStyle string (optional) - The style of window title bar. Default is default. Возможные значения:
    • default - Results in the standard title bar for macOS or Windows respectively.
    • hidden - Results in a hidden title bar and a full size content window. На macOS в левом верхнем углу окна все еще есть стандартное управление окном ("светофоры"). On Windows and Linux, when combined with titleBarOverlay: true it will activate the Window Controls Overlay (see titleBarOverlay for more information), otherwise no window controls will be shown.
    • hiddenInset macOS - Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
    • customButtonsOnHover macOS - Results in a hidden title bar and a full size content window, the traffic light buttons will display when being hovered over in the top left of the window. Note: This option is currently experimental.
  • titleBarOverlay Object | Boolean (optional) - When using a frameless window in conjunction with win.setWindowButtonVisibility(true) on macOS or using a titleBarStyle so that the standard window controls ("traffic lights" on macOS) are visible, this property enables the Window Controls Overlay JavaScript APIs and CSS Environment Variables. Specifying true will result in an overlay with default system colors. Default is