Added app icon - platform independent.
This commit is contained in:
parent
acffbec100
commit
9aa9ba7b1a
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
/node_modules/
|
/node_modules/
|
||||||
/.vs/
|
/.vs/
|
||||||
|
/.vscode/
|
@ -9,6 +9,6 @@ body, html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
background: url(../images/BrownWithWignette.jpg) no-repeat center center fixed;
|
background: url('../images/BrownWithWignette.jpg') no-repeat center center fixed;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
3636
app/assets/images/WesterosSealSquare.hqx
Normal file
3636
app/assets/images/WesterosSealSquare.hqx
Normal file
File diff suppressed because it is too large
Load Diff
BIN
app/assets/images/WesterosSealSquare.icns
Normal file
BIN
app/assets/images/WesterosSealSquare.icns
Normal file
Binary file not shown.
BIN
app/assets/images/WesterosSealSquare.ico
Normal file
BIN
app/assets/images/WesterosSealSquare.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
@ -1,8 +1,36 @@
|
|||||||
const remote = require('electron').remote;
|
const remote = require('electron').remote
|
||||||
|
|
||||||
document.addEventListener("keydown", function (e) {
|
//Opens DevTools window if you type "wcdev" in sequence.
|
||||||
if (e.keyCode === 123) { // F12
|
//This will crash the program if you are using multiple
|
||||||
var window = remote.getCurrentWindow();
|
//DevTools, for example the chrome debugger in VS Code.
|
||||||
window.toggleDevTools();
|
const match = [87, 67, 68, 69, 86]
|
||||||
|
let at = 0;
|
||||||
|
|
||||||
|
document.addEventListener('keydown', function (e) {
|
||||||
|
switch(e.keyCode){
|
||||||
|
case match[0]:
|
||||||
|
if(at === 0) ++at
|
||||||
|
break
|
||||||
|
case match[1]:
|
||||||
|
if(at === 1) ++at
|
||||||
|
break
|
||||||
|
case match[2]:
|
||||||
|
if(at === 2) ++at
|
||||||
|
break
|
||||||
|
case match[3]:
|
||||||
|
if(at === 3) ++at
|
||||||
|
case match[4]:
|
||||||
|
if(at === 4) ++at
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
at = 0
|
||||||
}
|
}
|
||||||
});
|
if(at === 5) {
|
||||||
|
var window = remote.getCurrentWindow()
|
||||||
|
window.toggleDevTools()
|
||||||
|
console.log('I would open it now!')
|
||||||
|
at = 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('Can you see me? ( ͡° ͜ʖ ͡°) Then it\'s working!')
|
16
index.js
16
index.js
@ -7,7 +7,7 @@ const url = require('url')
|
|||||||
let win
|
let win
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
win = new BrowserWindow({ width: 925, height: 500 })
|
win = new BrowserWindow({ width: 925, height: 500, icon: getPlatformIcon('WesterosSealSquare')})
|
||||||
|
|
||||||
win.loadURL(url.format({
|
win.loadURL(url.format({
|
||||||
pathname: path.join(__dirname, 'app', 'index.html'),
|
pathname: path.join(__dirname, 'app', 'index.html'),
|
||||||
@ -15,8 +15,6 @@ function createWindow() {
|
|||||||
slashes: true
|
slashes: true
|
||||||
}))
|
}))
|
||||||
|
|
||||||
//Open DevTools, this will be removed on release.
|
|
||||||
win.webContents.openDevTools()
|
|
||||||
win.setMenu(null)
|
win.setMenu(null)
|
||||||
|
|
||||||
win.on('closed', () => {
|
win.on('closed', () => {
|
||||||
@ -24,6 +22,18 @@ function createWindow() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPlatformIcon(filename){
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
filename = filename + '.icns'
|
||||||
|
} else if (process.platform === 'win32') {
|
||||||
|
filename = filename + '.ico'
|
||||||
|
} else {
|
||||||
|
filename = filename + '.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
return path.join(__dirname, 'app', 'assets', 'images', filename)
|
||||||
|
}
|
||||||
|
|
||||||
app.on('ready', createWindow);
|
app.on('ready', createWindow);
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user