UC done v1.0
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
const {app, BrowserWindow, screen, Menu} = require("electron");
|
||||
const path = require("path")
|
||||
|
||||
const isMac = process.platform === 'darwin';
|
||||
|
||||
const createMainWindow = ((title, width, height) => {
|
||||
const mainWindows = new BrowserWindow({
|
||||
title: title,
|
||||
width: width,
|
||||
height: height
|
||||
});
|
||||
|
||||
mainWindows.loadFile(path.join(__dirname, '..', 'renderer', 'index.html'))
|
||||
.then(r => console.log('Main window works!'));
|
||||
})
|
||||
|
||||
app.whenReady().then(() => {
|
||||
const title = "Application"
|
||||
const mainScreen = screen.getPrimaryDisplay();
|
||||
const {width: width, height: height} = mainScreen.size;
|
||||
createMainWindow(title, width / 1.5, height / 1.5)
|
||||
|
||||
app.on('activate', () => {
|
||||
if(BrowserWindow.getAllWindows().length === 0){
|
||||
createMainWindow(title, width, height);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () =>{
|
||||
if(!isMac){
|
||||
app.quit();
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content = "IE=edge">
|
||||
<meta name="viewport" content="width=device width, initial-scale=1.0">
|
||||
<title>App</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user