new icon, fix headless systems crashing

This commit is contained in:
Aria Moradi 2021-02-24 11:55:43 +03:30
parent 9613cda79a
commit 7c1c504482
4 changed files with 39 additions and 30 deletions

View File

@ -27,12 +27,17 @@ fun applicationSetup() {
} }
fun openInBrowser() { fun openInBrowser() {
try {
Desktop.browseURL("http://127.0.0.1:4567") Desktop.browseURL("http://127.0.0.1:4567")
} catch (e1: IOException) {
e1.printStackTrace()
}
} }
val icon = Main::class.java.getResource("/icon/faviconlogo.png") val icon = Main::class.java.getResource("/icon/faviconlogo.png")
fun systemTray(): SystemTray? { fun systemTray(): SystemTray? {
try {
// ref: https://github.com/dorkbox/SystemTray/blob/master/test/dorkbox/TestTray.java // ref: https://github.com/dorkbox/SystemTray/blob/master/test/dorkbox/TestTray.java
SystemTray.DEBUG = true; // for test apps, we always want to run in debug mode SystemTray.DEBUG = true; // for test apps, we always want to run in debug mode
if (System.getProperty("os.name").startsWith("Windows")) if (System.getProperty("os.name").startsWith("Windows"))
@ -49,8 +54,8 @@ fun systemTray(): SystemTray? {
ActionListener { ActionListener {
try { try {
Desktop.browseURL("http://127.0.0.1:4567") Desktop.browseURL("http://127.0.0.1:4567")
} catch (e1: IOException) { } catch (e: IOException) {
e1.printStackTrace() e.printStackTrace()
} }
} }
) )
@ -68,4 +73,8 @@ fun systemTray(): SystemTray? {
) )
return systemTray return systemTray
} catch (e: Exception) {
e.printStackTrace()
return null
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 KiB

View File

@ -2,14 +2,14 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="icon" href="%PUBLIC_URL%/favicon.ico"/> <link rel="icon" href="%PUBLIC_URL%/faviconlogo.ico"/>
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width"/> <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width"/>
<meta name="theme-color" content="#000000"/> <meta name="theme-color" content="#000000"/>
<meta <meta
name="description" name="description"
content="Web site created using create-react-app" content="A manga reader that runs tachiyomi's extensions"
/> />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/> <link rel="apple-touch-icon" href="%PUBLIC_URL%/faviconlogo.png"/>
<!-- <!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>Tachidesk</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>