From b32468452d69c97cd3acbd1a0f23f57063f0dca5 Mon Sep 17 00:00:00 2001 From: Senk Ju <18741573+SenkJu@users.noreply.github.com> Date: Thu, 21 Mar 2024 04:44:24 +0100 Subject: [PATCH 01/17] feat: ui improvements --- src/lib/Window.svelte | 86 +++++++++++++++++++------------ src/lib/common/ButtonClose.svelte | 2 +- src/lib/common/ToolTip.svelte | 4 +- src/lib/login/Facts.svelte | 54 +++++++++++-------- src/lib/main/LaunchArea.svelte | 5 +- src/lib/main/news/News.svelte | 18 ++++++- 6 files changed, 107 insertions(+), 62 deletions(-) diff --git a/src/lib/Window.svelte b/src/lib/Window.svelte index c3d455a..1c77f7a 100644 --- a/src/lib/Window.svelte +++ b/src/lib/Window.svelte @@ -5,58 +5,73 @@ import { check } from "@tauri-apps/plugin-updater"; import { relaunch } from "@tauri-apps/plugin-process"; - check().then((result) => { - console.debug("Update Check Result", result); - if (result && result.available) { - result.downloadAndInstall().then(() => { - relaunch().catch(e => console.error(e)); - }).catch(e => console.error("Download and Install Failed", e)); - } - }).catch(e => console.error("Update Check Failed", e)); + check() + .then((result) => { + console.debug("Update Check Result", result); + if (result && result.available) { + result + .downloadAndInstall() + .then(() => { + relaunch().catch((e) => console.error(e)); + }) + .catch((e) => + console.error("Download and Install Failed", e), + ); + } + }) + .catch((e) => console.error("Update Check Failed", e)); // Load options from file let options; - invoke("get_options").then((result) => { - options = result; + invoke("get_options") + .then((result) => { + options = result; - // Debug options - might be interesting to see what's in there - console.debug("Options", options); + // Debug options - might be interesting to see what's in there + console.debug("Options", options); - // Easy way to store options - options.store = function() { - console.debug("Storing options...", options); - invoke("store_options", { options }) - .catch(e => console.error(e)); - }; - }).catch(e => console.error(e)); + // Easy way to store options + options.store = function () { + console.debug("Storing options...", options); + invoke("store_options", { options }).catch((e) => + console.error(e), + ); + }; + }) + .catch((e) => console.error(e)); // Logout from current account function logout() { // Revoke the actual session - invoke("logout", { accountData: options.currentAccount }) - .catch(e => console.error(e)); + invoke("logout", { accountData: options.currentAccount }).catch((e) => + console.error(e), + ); // Remove account data from options data options.currentAccount = null; options.store(); } - invoke("check_online_status").then((result) => { - console.debug("Status", result); - }).catch(e => { - alert("You are offline! Please connect to the internet and restart the app.\n If this problem persists, please contact the developer.\n\n (Error: " + e + ")"); - console.error(e); - }); + invoke("check_online_status") + .then((result) => { + console.debug("Status", result); + }) + .catch((e) => { + alert( + "You are offline! Please connect to the internet and restart the app.\n If this problem persists, please contact the developer.\n\n (Error: " + + e + + ")", + ); + console.error(e); + });
-
- -
+
- {#if options } - {#if options.currentAccount } + {#if options} + {#if options.currentAccount} {:else} @@ -64,7 +79,6 @@ {:else}

The launcher is loading...

{/if} -
\ No newline at end of file + diff --git a/src/lib/main/LaunchArea.svelte b/src/lib/main/LaunchArea.svelte index c53552a..157bc2b 100644 --- a/src/lib/main/LaunchArea.svelte +++ b/src/lib/main/LaunchArea.svelte @@ -63,15 +63,14 @@ overflow: hidden; position: relative; display: flex; - align-items: center; + align-items: flex-end; } .version-info .banner .title { font-weight: 800; color: white; font-size: 18px; - max-width: 50%; - margin-left: 20px; + margin: 10px 20px; } .version-info .date { diff --git a/src/lib/main/news/News.svelte b/src/lib/main/news/News.svelte index 038d116..8ee73d6 100644 --- a/src/lib/main/news/News.svelte +++ b/src/lib/main/news/News.svelte @@ -15,8 +15,9 @@
-