Get Electron Titlebar Respect work nicely with TS

This commit is contained in:
Korbs 2023-08-30 16:17:22 -04:00
parent ccdbff838f
commit be60e0d7cd
No known key found for this signature in database

View file

@ -1,9 +1,14 @@
import {BrowserWindow} from 'electron' import {BrowserWindow} from 'electron'
import {info, window, splash} from '../../../configuration' import {info, window, splash} from '../../../configuration'
if (process.env.NODE_ENV === "development") {var devTools = true} if (process.env.NODE_ENV === "development") {var devTools = true}
else if (process.env.NODE_ENV === 'production') {var devTools =false} else if (process.env.NODE_ENV === 'production') {var devTools =false}
let mainWindow : BrowserWindow let mainWindow : BrowserWindow
const {TitlebarRespect} = require('electron-titlebar-respect')
TitlebarRespect({})
module.exports = { module.exports = {
launch: function() { launch: function() {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
@ -15,8 +20,8 @@ module.exports = {
show: false, show: false,
autoHideMenuBar: true, autoHideMenuBar: true,
transparent: true, transparent: true,
// frame: false, frame: global.frame,
// titleBarStyle: 'hiddenInset', titleBarStyle: global.titleBarStyle,
vibrancy: 'sidebar', // Window blur effect on macOS vibrancy: 'sidebar', // Window blur effect on macOS
backgroundMaterial: 'auto', // Window blur effect on Windows. Note: This method is only supported on Windows 11 22H2 and up. backgroundMaterial: 'auto', // Window blur effect on Windows. Note: This method is only supported on Windows 11 22H2 and up.
trafficLightPosition: { x: 25, y: 28 }, // Position of Traffic Light buttons on macOS trafficLightPosition: { x: 25, y: 28 }, // Position of Traffic Light buttons on macOS