mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-11 19:46:16 -08:00
refactor: extract titlebar menu to preload script
This commit is contained in:
1 parent
1aefcf3477
commit
bf8664bec5
6 files changed
+1009
-1370
No files matched your search
@@ -16,6 +16,7 @@ src/**/*.js
|
||||
!src/karma.conf.js
|
||||
*.js.map
|
||||
data.db
|
||||
preload.js
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
|
||||
@@ -17,6 +17,7 @@ function createWindow(): BrowserWindow {
|
||||
width: 1000,
|
||||
height: 800,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.js'),
|
||||
nodeIntegration: true,
|
||||
allowRunningInsecureContent: serve ? true : false,
|
||||
contextIsolation: false,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Color, Titlebar } from 'custom-electron-titlebar';
|
||||
import { app, BrowserWindow, Menu, MenuItem, shell } from 'electron';
|
||||
import * as path from 'path';
|
||||
import {
|
||||
@@ -18,7 +17,6 @@ export class AppMenu {
|
||||
constructor(appWindow: BrowserWindow) {
|
||||
this.window = appWindow;
|
||||
this.initMenu();
|
||||
this.initTitleBar();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,16 +34,6 @@ export class AppMenu {
|
||||
this.menu.append(this.getHelpMenu());
|
||||
}
|
||||
|
||||
initTitleBar() {
|
||||
if (process.platform !== 'darwin') {
|
||||
new Titlebar({
|
||||
backgroundColor: Color.fromHex('#000'),
|
||||
itemBackgroundColor: Color.fromHex('#222'),
|
||||
enableMnemonics: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the application menu
|
||||
*/
|
||||
|
||||
Generated
+996
-1357
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,9 @@
|
||||
import { Color, Titlebar } from 'custom-electron-titlebar';
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
new Titlebar({
|
||||
backgroundColor: Color.fromHex('#000'),
|
||||
itemBackgroundColor: Color.fromHex('#222'),
|
||||
enableMnemonics: true,
|
||||
});
|
||||
});
|
||||
+2
-1
@@ -20,7 +20,8 @@
|
||||
"api.ts",
|
||||
"epg-worker.ts",
|
||||
"main.ts",
|
||||
"menu.ts"
|
||||
"menu.ts",
|
||||
"preload.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
||||
Reference in new issue
Block a user