From 2c7f7f667ccb10271db072a4b4e6bf8fd4912f2b Mon Sep 17 00:00:00 2001 From: Djuri Baars Date: Mon, 2 Sep 2024 22:38:11 +0200 Subject: [PATCH] Allow disabling frontlight --- src/lib/locales/de.json | 3 +- src/lib/locales/en.json | 3 +- src/lib/locales/es.json | 3 +- src/lib/locales/nl.json | 3 +- src/routes/Control.svelte | 2 +- src/routes/Settings.svelte | 108 ++++++++++++++++++++----------------- 6 files changed, 69 insertions(+), 53 deletions(-) diff --git a/src/lib/locales/de.json b/src/lib/locales/de.json index 21124e2..e34c1f6 100644 --- a/src/lib/locales/de.json +++ b/src/lib/locales/de.json @@ -37,7 +37,8 @@ "mempoolInstanceHelpText": "Nur wirksam, wenn die BTClock-Datenquelle deaktiviert ist. \nZur Anwendung ist ein Neustart erforderlich.", "luxLightToggle": "Automatisches Umschalten des Frontlichts bei Lux", "wpTimeout": "WiFi-Konfigurationsportal timeout", - "useNostr": "Nostr-Datenquelle verwenden" + "useNostr": "Nostr-Datenquelle verwenden", + "flDisable": "Displaybeleuchtung deaktivieren" }, "control": { "systemInfo": "Systeminfo", diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index ab664f9..188c794 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -46,7 +46,8 @@ "bitaxeEnabled": "Enable BitAxe", "nostrZapPubkey": "Nostr Zap pubkey", "invalidNostrPubkey": "Invalid Nostr pubkey, note that your pubkey does NOT start with npub.", - "convertingValidNpub": "Converting valid npub to pubkey" + "convertingValidNpub": "Converting valid npub to pubkey", + "flDisable": "Disable frontlight" }, "control": { "systemInfo": "System info", diff --git a/src/lib/locales/es.json b/src/lib/locales/es.json index dcff2a6..6bf8260 100644 --- a/src/lib/locales/es.json +++ b/src/lib/locales/es.json @@ -36,7 +36,8 @@ "mempoolInstanceHelpText": "Solo es efectivo cuando la fuente de datos BTClock está deshabilitada. \nEs necesario reiniciar para aplicar.", "luxLightToggle": "Cambio automático de luz frontal en lux", "wpTimeout": "Portal de configuración WiFi timeout", - "useNostr": "Utilice la fuente de datos Nostr" + "useNostr": "Utilice la fuente de datos Nostr", + "flDisable": "Desactivar luz de la pantalla" }, "control": { "turnOff": "Apagar", diff --git a/src/lib/locales/nl.json b/src/lib/locales/nl.json index 2af12ca..e984c98 100644 --- a/src/lib/locales/nl.json +++ b/src/lib/locales/nl.json @@ -37,7 +37,8 @@ "mempoolInstanceHelpText": "Alleen effectief als de BTClock-gegevensbron is uitgeschakeld. \nOm toe te passen is een herstart nodig.", "luxLightToggle": "Schakelen displaylicht op lux", "wpTimeout": "WiFi-config-portal timeout", - "useNostr": "Gebruik Nostr-gegevensbron" + "useNostr": "Gebruik Nostr-gegevensbron", + "flDisable": "Schakel Displaylicht uit" }, "control": { "systemInfo": "Systeeminformatie", diff --git a/src/routes/Control.svelte b/src/routes/Control.svelte index 6ed2642..9874b11 100644 --- a/src/routes/Control.svelte +++ b/src/routes/Control.svelte @@ -187,7 +187,7 @@
{/if} - {#if $settings.hasFrontlight} + {#if $settings.hasFrontlight && !$settings.flDisable}

{$_('section.control.frontlight')}

diff --git a/src/routes/Settings.svelte b/src/routes/Settings.svelte index ab7430d..bd0141a 100644 --- a/src/routes/Settings.svelte +++ b/src/routes/Settings.svelte @@ -286,7 +286,7 @@ /> - {#if $settings.hasFrontlight} + {#if $settings.hasFrontlight && !$settings.flDisable} - - - - - - - - - + + {#if $settings.hasFrontlight} + + + + {/if} + {#if $settings.hasFrontlight && !$settings.flDisable} + + + + + + + {/if} + + + {/if} - {#if $settings.hasFrontlight} - - - - - - - {/if} + + + + + +