From 83f3662b9ae150047c2c23612e5c1c23d20b609e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sun, 14 May 2023 03:24:13 +0200 Subject: [PATCH] Styling: style most buttons --- Logic/State/GeoLocationState.ts | 4 +- UI/Base/BackButton.svelte | 16 + UI/Base/FromHtml.svelte | 3 +- UI/Base/LoginButton.svelte | 24 +- UI/Base/MapControlButton.svelte | 2 +- UI/Base/NextButton.svelte | 20 + UI/Base/SubtleButton.svelte | 16 +- UI/Base/TabbedGroup.svelte | 10 +- UI/Base/Tr.svelte | 3 +- UI/BigComponents/ContactLink.svelte | 4 +- UI/BigComponents/Filterview.svelte | 14 - UI/BigComponents/Geosearch.svelte | 4 + UI/BigComponents/SelectedElementTitle.svelte | 47 +- UI/BigComponents/UserProfile.svelte | 8 +- UI/Input/Checkboxes.ts | 15 +- UI/Popup/AddNewPoint/AddNewPoint.svelte | 473 +++++++++--------- UI/Popup/AddNewPoint/PresetList.svelte | 159 +++--- .../TagRendering/TagRenderingQuestion.svelte | 2 +- UI/StylesheetTestGui.svelte | 16 +- UI/ThemeViewGUI.svelte | 72 ++- .../charging_station/charging_station.json | 2 +- assets/svg/crosshair.svg | 23 +- assets/svg/login.svg | 42 +- index.css | 166 +++--- langs/ca.json | 1 - langs/cs.json | 1 - langs/da.json | 1 - langs/de.json | 1 - langs/en.json | 4 +- langs/es.json | 1 - langs/fil.json | 1 - langs/fr.json | 1 - langs/gl.json | 1 - langs/hu.json | 1 - langs/id.json | 1 - langs/it.json | 1 - langs/ja.json | 1 - langs/layers/en.json | 18 + langs/nb_NO.json | 1 - langs/nl.json | 3 +- langs/pl.json | 1 - langs/pt.json | 1 - langs/pt_BR.json | 1 - langs/ru.json | 1 - langs/zh_Hant.json | 1 - public/css/index-tailwind-output.css | 203 ++++---- 46 files changed, 720 insertions(+), 671 deletions(-) create mode 100644 UI/Base/BackButton.svelte create mode 100644 UI/Base/NextButton.svelte diff --git a/Logic/State/GeoLocationState.ts b/Logic/State/GeoLocationState.ts index f0a9566be..c18da5284 100644 --- a/Logic/State/GeoLocationState.ts +++ b/Logic/State/GeoLocationState.ts @@ -2,7 +2,7 @@ import { UIEventSource } from "../UIEventSource" import { LocalStorageSource } from "../Web/LocalStorageSource" import { QueryParameters } from "../Web/QueryParameters" -type GeolocationState = "prompt" | "requested" | "granted" | "denied" +export type GeolocationPermissionState = "prompt" | "requested" | "granted" | "denied" export interface GeoLocationPointProperties extends GeolocationCoordinates { id: "gps" @@ -21,7 +21,7 @@ export class GeoLocationState { * 'granted' means that it is granted * 'denied' means that we don't have access */ - public readonly permission: UIEventSource = new UIEventSource("prompt") + public readonly permission: UIEventSource = new UIEventSource("prompt") /** * Important to determine e.g. if we move automatically on fix or not diff --git a/UI/Base/BackButton.svelte b/UI/Base/BackButton.svelte new file mode 100644 index 000000000..88ee19934 --- /dev/null +++ b/UI/Base/BackButton.svelte @@ -0,0 +1,16 @@ + + + dispatch("click")} options={{extraClasses:clss+ " flex items-center"}}> + + + diff --git a/UI/Base/FromHtml.svelte b/UI/Base/FromHtml.svelte index f947b9de3..0f5837629 100644 --- a/UI/Base/FromHtml.svelte +++ b/UI/Base/FromHtml.svelte @@ -11,9 +11,10 @@ } } + export let clss = "" {#if src !== undefined} - + {/if} diff --git a/UI/Base/LoginButton.svelte b/UI/Base/LoginButton.svelte index bb86bf244..2c710c2cf 100644 --- a/UI/Base/LoginButton.svelte +++ b/UI/Base/LoginButton.svelte @@ -1,15 +1,17 @@ - osmConnection.AttemptLogin()}> - - - - - + diff --git a/UI/Base/MapControlButton.svelte b/UI/Base/MapControlButton.svelte index 7528c0ba9..34ced51a4 100644 --- a/UI/Base/MapControlButton.svelte +++ b/UI/Base/MapControlButton.svelte @@ -8,6 +8,6 @@ - diff --git a/UI/Base/NextButton.svelte b/UI/Base/NextButton.svelte new file mode 100644 index 000000000..4feb7fc18 --- /dev/null +++ b/UI/Base/NextButton.svelte @@ -0,0 +1,20 @@ + + + dispatch("click")} options={{extraClasses: clss+" flex items-center"}}> + +
+ + +
+
diff --git a/UI/Base/SubtleButton.svelte b/UI/Base/SubtleButton.svelte index 9bbe097f1..464bba17e 100644 --- a/UI/Base/SubtleButton.svelte +++ b/UI/Base/SubtleButton.svelte @@ -12,11 +12,10 @@ let imgClasses = "block justify-center shrink-0 mr-4 " + (options?.imgSize ?? "h-11 w-11"); const dispatch = createEventDispatcher<{click}>() - console.log("Slots:", $$slots) - - diff --git a/UI/Base/TabbedGroup.svelte b/UI/Base/TabbedGroup.svelte index 54ffb52f0..c84901c9f 100644 --- a/UI/Base/TabbedGroup.svelte +++ b/UI/Base/TabbedGroup.svelte @@ -22,7 +22,7 @@
{#if $$slots.title1} - "tab "+(selected ? "selected" : "secondary")}> + "tab "+(selected ? "primary" : "")}>
Tab 0 @@ -31,28 +31,28 @@ {/if} {#if $$slots.title1} - "tab "+(selected ? "selected" : "secondary")}> + "tab "+(selected ? "primary" : "")}>
{/if} {#if $$slots.title2} - "tab "+(selected ? "selected" : "secondary")}> + "tab "+(selected ? "primary" : "")}>
{/if} {#if $$slots.title3} - "tab "+(selected ? "selected" : "secondary")}> + "tab "+(selected ? "primary" : "")}>
{/if} {#if $$slots.title4} - "tab "+(selected ? "selected" : "secondary")}> + "tab "+(selected ? "primary" : "")}>
diff --git a/UI/Base/Tr.svelte b/UI/Base/Tr.svelte index adbb54a6a..2fa188cd8 100644 --- a/UI/Base/Tr.svelte +++ b/UI/Base/Tr.svelte @@ -10,6 +10,7 @@ import WeblateLink from "./WeblateLink.svelte"; export let t: Translation; + export let cls: string = "" export let tags: Record | undefined = undefined; // Text for the current language let txt: string | undefined; @@ -29,7 +30,7 @@ {#if t} - + diff --git a/UI/BigComponents/ContactLink.svelte b/UI/BigComponents/ContactLink.svelte index 0fd252959..c26ea8860 100644 --- a/UI/BigComponents/ContactLink.svelte +++ b/UI/BigComponents/ContactLink.svelte @@ -40,9 +40,9 @@ {resource.resolved?.description} {#if resource.languageCodes?.indexOf($language) >= 0} - +
availableTranslation.Clone()} /> - +
{/if}
diff --git a/UI/BigComponents/Filterview.svelte b/UI/BigComponents/Filterview.svelte index c64dd26af..ce1b5cf76 100644 --- a/UI/BigComponents/Filterview.svelte +++ b/UI/BigComponents/Filterview.svelte @@ -111,17 +111,3 @@ $: onDestroy( {/if} - diff --git a/UI/BigComponents/Geosearch.svelte b/UI/BigComponents/Geosearch.svelte index 0ce04ea03..44aced7f0 100644 --- a/UI/BigComponents/Geosearch.svelte +++ b/UI/BigComponents/Geosearch.svelte @@ -11,6 +11,7 @@ import { Geocoding } from "../../Logic/Osm/Geocoding"; import { BBox } from "../../Logic/BBox"; import { GeoIndexedStoreForLayer } from "../../Logic/FeatureSource/Actors/GeoIndexedStore"; + import {createEventDispatcher} from "svelte"; export let perLayer: ReadonlyMap | undefined = undefined; export let bounds: UIEventSource; @@ -34,6 +35,8 @@ } ); + const dispatch = createEventDispatcher<{searchCompleted}>() + async function performSearch() { try { isRunning = true; @@ -59,6 +62,7 @@ } } + dispatch("searchCompleted") } catch (e) { console.error(e); feedback = Translations.t.general.search.error.txt; diff --git a/UI/BigComponents/SelectedElementTitle.svelte b/UI/BigComponents/SelectedElementTitle.svelte index 151e1552d..960f6bd11 100644 --- a/UI/BigComponents/SelectedElementTitle.svelte +++ b/UI/BigComponents/SelectedElementTitle.svelte @@ -4,7 +4,6 @@ import LayerConfig from "../../Models/ThemeConfig/LayerConfig"; import type {SpecialVisualizationState} from "../SpecialVisualization"; import TagRenderingAnswer from "../Popup/TagRendering/TagRenderingAnswer.svelte"; - import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte"; import {onDestroy} from "svelte"; import Translations from "../i18n/Translations"; import Tr from "../Base/Tr.svelte"; @@ -31,31 +30,37 @@ {#if _tags._deleted === "yes"} {:else} -