From a7c70646367ed9324e5c5405d33c82f6bfcfc3c2 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 9 Aug 2024 14:37:57 +0200 Subject: [PATCH] UX: improve rendering of disabled GPS button (esp. if not available) --- assets/svg/location-refused.svg | 4 ++-- src/UI/Base/MapControlButton.svelte | 1 + src/UI/ThemeViewGUI.svelte | 4 +++- src/assets/svg/Location_refused.svelte | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/svg/location-refused.svg b/assets/svg/location-refused.svg index 20d0f2f1e..2e3fceaca 100644 --- a/assets/svg/location-refused.svg +++ b/assets/svg/location-refused.svg @@ -1,7 +1,7 @@ - + - \ No newline at end of file + diff --git a/src/UI/Base/MapControlButton.svelte b/src/UI/Base/MapControlButton.svelte index afd42306a..610d864be 100644 --- a/src/UI/Base/MapControlButton.svelte +++ b/src/UI/Base/MapControlButton.svelte @@ -27,6 +27,7 @@ on:click={(e) => dispatch("click", e)} on:keydown use:ariaLabelStore={arialabelString} + disabled={!$enabled} class={twJoin( "pointer-events-auto relative h-fit w-fit rounded-full", cls, diff --git a/src/UI/ThemeViewGUI.svelte b/src/UI/ThemeViewGUI.svelte index 27ab873d4..23a6ba53c 100644 --- a/src/UI/ThemeViewGUI.svelte +++ b/src/UI/ThemeViewGUI.svelte @@ -208,7 +208,8 @@ let openBackgroundButton: UIEventSource = new UIEventSource(undefined) let addNewFeatureMode = state.userRelatedState.addNewFeatureMode - let gpsButtonAriaLabel = state.geolocation.geolocationState.gpsAvailable.map(available => { + let gpsAvailable = state.geolocation.geolocationState.gpsAvailable + let gpsButtonAriaLabel = gpsAvailable.map(available => { if (!available) { return Translations.t.general.labels.locationNotAvailable } @@ -433,6 +434,7 @@
state.geolocationControl.handleClick()} on:keydown={forwardEventToMap} diff --git a/src/assets/svg/Location_refused.svelte b/src/assets/svg/Location_refused.svelte index 5c6b0a28c..a3588889f 100644 --- a/src/assets/svg/Location_refused.svelte +++ b/src/assets/svg/Location_refused.svelte @@ -1,4 +1,4 @@ - \ No newline at end of file + \ No newline at end of file