Skip to content

Commit

Permalink
Enable title bar #159
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Dec 11, 2021
1 parent 3119b7d commit 88021a7
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { app } = require("@electron/remote")
const electron = require("electron")
const { app, Menu, getCurrentWindow } = require("@electron/remote")
const Titlebar = require("@6c65726f79/custom-titlebar")
const path = require("path")
const fs = require("fs")
const ipc = electron.ipcRenderer
Expand Down Expand Up @@ -83,3 +83,18 @@ document.addEventListener("keydown", (event) => {
*/
document.addEventListener("dragover", (event) => event.preventDefault())
document.addEventListener("drop", (event) => event.preventDefault())

/**
* Title bar
*/
const currentWindow = getCurrentWindow()
let titlebar

if (process.platform === "win32") {
currentWindow.webContents.once("dom-ready", () => {
titlebar = new Titlebar({
menu: Menu.getApplicationMenu(),
browserWindow: currentWindow,
backgroundColor: "#000000",
icon: "../../img/icon.png",
unfocusEffect: false,

0 comments on commit 88021a7

Please sign in to comment.