Add: cool frame of the window, default: off

This commit is contained in:
cutls
2020-03-19 13:17:02 +09:00
parent d44724d784
commit 3531c338de
10 changed files with 95 additions and 18 deletions

View File

@@ -4,18 +4,21 @@ var ipc = electron.ipcRenderer
//title bar
const customTitlebar = require('custom-electron-titlebar')
window.addEventListener('DOMContentLoaded', () => {
const file = location.href.substr(-10)
if (
file == 'index.html' ||
file == '/acct.html' ||
file == 'tting.html'
) {
new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#000'),
titleHorizontalAlignment: 'right',
icon: '../../img/desk.png'
ipc.send('frameCheck', '')
ipc.on('frame', function(event, args) {
const file = location.href.substr(-10)
if (
file == 'index.html' ||
file == '/acct.html' ||
file == 'tting.html'
) {
new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex('#000'),
titleHorizontalAlignment: 'right',
icon: '../../img/desk.png'
})
}
})
}
})
onmessage = function(e) {
@@ -65,6 +68,8 @@ onmessage = function(e) {
ipc.send('theme-json-request', e.data[1])
} else if (e.data[0] == 'ha') {
ipc.send('ha', e.data[1])
} else if (e.data[0] == 'frameSet') {
ipc.send('frameSet', e.data[1])
} else if (e.data[0] == 'ua') {
ipc.send('ua', e.data[1])
} else if (e.data[0] == 'aboutData') {