diff options
author | 0neGal <mail@0negal.com> | 2021-12-27 03:04:03 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2021-12-27 03:06:02 +0100 |
commit | 8dcc759cf4a5af32c25dc7ad26ffb2c6c258a7ef (patch) | |
tree | 4b8aab612886bf41cfb749f887ef192feebde944 | |
parent | fa94f92e15b5e1e7fe2bcdeb4d74b153cc47c133 (diff) | |
download | Viper-8dcc759cf4a5af32c25dc7ad26ffb2c6c258a7ef.tar.gz Viper-8dcc759cf4a5af32c25dc7ad26ffb2c6c258a7ef.zip |
made the app prettier on windows
I removed the titlebar, which I already had gone on my Linux system,
besides that I also made it so the body of Viper can be held down to
drag it around. And then added an exit button.
-rw-r--r-- | src/app/index.html | 1 | ||||
-rw-r--r-- | src/app/main.css | 5 | ||||
-rw-r--r-- | src/app/main.js | 1 | ||||
-rw-r--r-- | src/index.js | 5 |
4 files changed, 10 insertions, 2 deletions
diff --git a/src/app/index.html b/src/app/index.html index b7b260d..67d2e5c 100644 --- a/src/app/index.html +++ b/src/app/index.html @@ -8,6 +8,7 @@ <div class="line"> <div class="text">Welcome to Viper!</div> <div class="buttons"> + <button id="exit" onclick="exit()">Exit</button> <button id="update" onclick="update()">Update</button> <button id="setpath" onclick="setpath()">Game Path</button> </div> diff --git a/src/app/main.css b/src/app/main.css index 1de3eea..4578f87 100644 --- a/src/app/main.css +++ b/src/app/main.css @@ -7,6 +7,7 @@ body, button, input { font-size: 18px; font-weight: 700; overflow: hidden; + -webkit-app-region: drag; color: var(--foreground); text-transform: uppercase; background: var(--background); @@ -31,6 +32,8 @@ button, .text { transition: 0.2s ease-in-out; } +button {-webkit-app-region: no-drag;} + button:hover {opacity: 0.9} button:active { opacity: 0.7; @@ -39,5 +42,5 @@ button:active { #update {background: #81A1C1} #setpath {background: #5E81AC} -#vanilla {background: #656E7F} #northstar {background: #C7777F} +#vanilla, #exit {background: #656E7F} diff --git a/src/app/main.js b/src/app/main.js index 82d6526..17389b2 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -16,6 +16,7 @@ if (fs.existsSync(settings.file)) { setpath(); } +function exit() {ipcRenderer.send("exit")} function update() {ipcRenderer.send("update")} function setpath() {ipcRenderer.send("setpath")} diff --git a/src/index.js b/src/index.js index 6095803..6924b57 100644 --- a/src/index.js +++ b/src/index.js @@ -10,10 +10,12 @@ const cli = require("./cli"); function start() { win = new BrowserWindow({ - width: 500, + width: 600, height: 115, show: false, title: "Viper", + resizable: false, + titleBarStyle: "hidden", webPreferences: { nodeIntegration: true, contextIsolation: false, @@ -25,6 +27,7 @@ function start() { win.webContents.once("dom-ready", () => {win.show()}); ipcMain.on("setpath", (event) => {utils.setpath(win)}) + ipcMain.on("exit", (event) => {process.exit(0)}) } ipcMain.on("launch", (event) => {utils.launch()}) |