From 86019ae090b990a555a9bcba93aa83aa66f1a784 Mon Sep 17 00:00:00 2001 From: BrewingWeasel Date: Sat, 28 Oct 2023 19:34:02 -0400 Subject: [PATCH] feat: add note fields setting option --- src-ui/src/settings.rs | 26 ++++++++++++++++++++++++++ src-ui/style.css | 7 ++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src-ui/src/settings.rs b/src-ui/src/settings.rs index 271d0aa..8d627aa 100644 --- a/src-ui/src/settings.rs +++ b/src-ui/src/settings.rs @@ -36,6 +36,7 @@ pub fn SettingsChanger(settings: Resource<(), Settings>) -> impl IntoView { let (model, set_model) = create_signal(old_settings.model); let (deck, set_deck) = create_signal(old_settings.deck); let (note, set_note) = create_signal(old_settings.note_type); + let (note_fields, set_note_fields) = create_signal(old_settings.note_fields); let new_dicts = old_settings .dicts @@ -61,6 +62,8 @@ pub fn SettingsChanger(settings: Resource<(), Settings>) -> impl IntoView {
+
+
@@ -75,6 +78,7 @@ pub fn SettingsChanger(settings: Resource<(), Settings>) -> impl IntoView { updater.model = model(); updater.deck = deck(); updater.note_type = note(); + updater.note_fields = note_fields(); updater.dicts = dicts().iter().map(|(_, (r, _))| r()).collect(); }); save_settings(settings().unwrap()); @@ -106,6 +110,28 @@ fn SimpleTextSetting( } } +#[component] +fn SimpleTextAreaSetting( + readsig: ReadSignal, + writesig: WriteSignal, + name: &'static str, + desc: &'static str, +) -> impl IntoView { + view! { +
+ +