From 980594252d2edf60f93b6c741a878c4108404b2b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 12 Dec 2023 12:33:31 +1000 Subject: [PATCH] Move globe icon into separate Svelte file Confirmed correct layout in RTL mode. I experimented with adding a tooltip as well, as suggested in https://forums.ankiweb.net/t/anki-23-12-beta/37771/82, but it's confusing as we already change the mouse cursor/underline when the user hovers over a label. Given the help text universally starts with "affects the entire collection", I think that's good enough. --- ftl/core/deck-config.ftl | 4 ---- ts/deck-options/AdvancedOptions.svelte | 7 ++++--- ts/deck-options/CardStateCustomizer.svelte | 3 ++- ts/deck-options/DailyLimits.svelte | 14 ++++++-------- ts/deck-options/FsrsOptions.svelte | 3 ++- ts/deck-options/GlobalLabel.svelte | 9 +++++++++ 6 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 ts/deck-options/GlobalLabel.svelte diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index 517e41f0d..d5530d401 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -1,9 +1,5 @@ ### Text shown on the "Deck Options" screen -# Text added to an option name when it affects all decks at once, e.g. -# "FSRS 🌐" -deck-config-all-decks = { $option } 🌐 - ## Top section # Used in the deck configuration screen to show how many decks are used diff --git a/ts/deck-options/AdvancedOptions.svelte b/ts/deck-options/AdvancedOptions.svelte index 93e18b454..7fdc72d62 100644 --- a/ts/deck-options/AdvancedOptions.svelte +++ b/ts/deck-options/AdvancedOptions.svelte @@ -17,6 +17,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { type HelpItem, HelpItemScheduler } from "../components/types"; import CardStateCustomizer from "./CardStateCustomizer.svelte"; import FsrsOptions from "./FsrsOptions.svelte"; + import GlobalLabel from "./GlobalLabel.svelte"; import type { DeckOptionsState } from "./lib"; import SpinBoxFloatRow from "./SpinBoxFloatRow.svelte"; import SpinBoxRow from "./SpinBoxRow.svelte"; @@ -32,7 +33,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const settings = { fsrs: { - title: tr.deckConfigAllDecks({ option: "FSRS" }), + title: "FSRS", help: tr.deckConfigFsrsTooltip(), url: HelpPage.DeckOptions.fsrs, }, @@ -102,7 +103,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html sched: HelpItemScheduler.SM2, }, customScheduling: { - title: tr.deckConfigAllDecks({ option: tr.deckConfigCustomScheduling() }), + title: tr.deckConfigCustomScheduling(), help: tr.deckConfigCustomSchedulingTooltip(), url: "https://faqs.ankiweb.net/the-2021-scheduler.html#add-ons-and-custom-scheduling", }, @@ -139,7 +140,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html on:click={() => openHelpModal(Object.keys(settings).indexOf("fsrs"))} > - {settings.fsrs.title} + diff --git a/ts/deck-options/CardStateCustomizer.svelte b/ts/deck-options/CardStateCustomizer.svelte index 5d2d961cc..f4ceb664f 100644 --- a/ts/deck-options/CardStateCustomizer.svelte +++ b/ts/deck-options/CardStateCustomizer.svelte @@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +{title} 🌐