Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit aae6260

Browse files
committed
🎨 Code restructuring
1 parent 2ced594 commit aae6260

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1169
-914
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ typings/
189189
dist
190190
build/
191191
*.map
192+
index.js
193+
main.js
192194

193195
# Gatsby files
194196
.cache/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Alex Torres
3+
Copyright (c) 2018 - now Alex Torres
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ import { setupTitlebar, attachTitlebarToWindow } from "custom-electron-titlebar/
3030
setupTitlebar();
3131

3232
function createWindow() {
33+
// Create the browser window.
34+
const mainWindow = new BrowserWindow({
35+
width: 800,
36+
height: 600,
37+
titleBarStyle: 'hidden',
38+
//frame: false, // needed if process.versions.electron < 14
39+
webPreferences: {
40+
preload: path.join(__dirname, 'preload.js')
41+
}
42+
});
43+
3344
...
3445

3546
// attach fullscreen(f11 and not 'maximized') && focus listeners

example/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
const { app, BrowserWindow, Menu } = require('electron');
33
const path = require('path');
44
const { setupTitlebar, attachTitlebarToWindow } = require('custom-electron-titlebar/main');
5+
56
// setup the titlebar main process
67
setupTitlebar();
78

@@ -20,8 +21,6 @@ createWindow = () => {
2021
const menu = Menu.buildFromTemplate(exampleMenuTemplate());
2122
Menu.setApplicationMenu(menu);
2223

23-
24-
2524
// and load the index.html of the app.
2625
mainWindow.loadFile('index.html');
2726

example/preload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let titlebar;
88
window.addEventListener('DOMContentLoaded', () => {
99
titlebar = new Titlebar({
1010
backgroundColor: Color.fromHex("#388e3c"),
11-
itemBackgroundColor: Color.fromHex("#121212"),
11+
itemBackgroundColor: Color.fromHex("#ffffff"),
1212
svgColor: Color.WHITE,
1313
icon: path.join(__dirname, '/assets/images', '/icon.svg'),
1414
//menu: null // = do not automatically use Menu.applicationMenu

0 commit comments

Comments
 (0)