From 705869ea14d0f758aebe03164ebe61af84dfa0e4 Mon Sep 17 00:00:00 2001 From: m00nwtchr Date: Sat, 27 Jul 2024 22:18:14 +0200 Subject: [PATCH] Update to latest iced (2/2) --- Cargo.lock | 95 +++++++-------- Cargo.toml | 22 +--- src/component/attributes.rs | 15 +-- src/component/forms.rs | 34 ++++-- src/component/integrity.rs | 49 ++++---- src/component/merits.rs | 55 ++++++--- src/component/mod.rs | 16 +-- src/component/traits.rs | 60 +++++---- src/main.rs | 23 ++-- src/view/character_list.rs | 9 +- src/view/creator.rs | 4 +- src/view/equipment.rs | 46 +++---- src/view/mod.rs | 8 +- src/view/overview.rs | 47 +++----- src/view/splat_extras.rs | 234 ++++++++++++++++-------------------- 15 files changed, 344 insertions(+), 373 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1d77e2..c1c72fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,9 +111,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -126,33 +126,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -630,9 +630,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "com" @@ -1014,9 +1014,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -1024,9 +1024,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", @@ -1710,7 +1710,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "toml 0.8.15", + "toml 0.8.16", "unic-langid", ] @@ -2031,9 +2031,9 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -2083,9 +2083,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] @@ -2321,13 +2321,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2600,9 +2601,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" dependencies = [ "memchr", ] @@ -3486,9 +3487,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -3957,9 +3958,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.1" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", @@ -3968,14 +3969,14 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -4016,21 +4017,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.16", + "toml_edit 0.22.17", ] [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" dependencies = [ "serde", ] @@ -4048,15 +4049,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.15", + "winnow 0.6.16", ] [[package]] @@ -4279,9 +4280,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -4984,9 +4985,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.15" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" +checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" dependencies = [ "memchr", ] @@ -5066,9 +5067,9 @@ checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "xxhash-rust" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] name = "yansi" diff --git a/Cargo.toml b/Cargo.toml index be39440..6b5dd3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,17 +33,6 @@ inherits = "test" [dependencies] iced = { version = "0.12", features = ["lazy", "advanced"] } -#iced_lazy = "0.6" -#iced_native = "0.10" - -# iced_style = "0.5" -# iced = { git = "https://github.com/iced-rs/iced" } -# iced_lazy = { git = "https://github.com/iced-rs/iced" } -# iced_native = { git = "https://github.com/iced-rs/iced" } -# iced_aw = {version = "0.2", default-features = false, features = ["pure", "tabs"]} -# iced_aw = {git = "https://github.com/iced-rs/iced_aw", features = ["pure", "tabs"]} -# iced_aw = { git = "https://github.com/genusistimelord/iced_aw", features = ["tabs"] } -log = "0.4" cofd = { git = "https://github.com/m00nwtchr/cofd.git" } codex-scraper = { git = "https://github.com/m00nwtchr/cofd-miner.git" } @@ -51,22 +40,19 @@ codex-scraper = { git = "https://github.com/m00nwtchr/cofd-miner.git" } closure = "0.3" lazy_static = "1" cfg-if = "1" +itertools = "0.13" +once_cell = "1.4" +anyhow = "1" +log = "0.4" ron = "0.9.0-alpha.0" serde = "1" -itertools = "0.13" - - i18n-embed = { version = "0.14", features = ["fluent-system"] } i18n-embed-fl = "0.8" rust-embed = "8" unic-langid = { version = "0.9", features = ["macros"] } -once_cell = "1.4" - -anyhow = "1" - [target.'cfg(not(target_arch = "wasm32"))'.dependencies] i18n-embed = { version = "0.14", features = ["desktop-requester"] } env_logger = "0.11" diff --git a/src/component/attributes.rs b/src/component/attributes.rs index fed5cbe..a5fbb9b 100644 --- a/src/component/attributes.rs +++ b/src/component/attributes.rs @@ -1,12 +1,5 @@ use std::{cell::RefCell, rc::Rc}; -use crate::widget::dots; -use crate::{ - fl, - i18n::flt, - widget::dots::{Shape, SheetDots}, - Element, H2_SIZE, TITLE_SPACING, -}; use cofd::{ character::{ modifier::ModifierTarget, @@ -20,6 +13,14 @@ use iced::{ Alignment, Length, }; +use crate::widget::dots; +use crate::{ + fl, + i18n::flt, + widget::dots::{Shape, SheetDots}, + Element, H2_SIZE, TITLE_SPACING, +}; + pub struct AttributeBar { // attributes: Attributes, character: Rc>, diff --git a/src/component/forms.rs b/src/component/forms.rs index 21a2ab6..fac1d73 100644 --- a/src/component/forms.rs +++ b/src/component/forms.rs @@ -1,9 +1,3 @@ -use iced::{ - alignment, - widget::{button, column, row, text, text_input, Column, Row}, - Length, -}; -use iced_lazy::Component; use std::{cell::RefCell, rc::Rc}; use crate::{i18n::flt, Element, INPUT_PADDING}; @@ -15,6 +9,12 @@ use cofd::{ Splat, }, }; +use iced::widget::{component, Component}; +use iced::{ + alignment, + widget::{button, column, row, text, text_input, Column, Row}, + Length, +}; pub struct FormsComponent { character: Rc>, @@ -45,7 +45,10 @@ impl FormsComponent { } } - fn mk_col(&self, form: Form, character: &Character) -> Element { + fn mk_col(&self, form: Form, character: &Character) -> Element + where + Theme: 'static + text::StyleSheet + text_input::StyleSheet + button::StyleSheet, + { let mut col = Column::new(); let mut vec: Vec = vec![ @@ -77,7 +80,9 @@ impl FormsComponent { col = col.push(row![ text(format!("{name}: ")), - text_input("", &val.to_string(), |_val| Event::Msg).padding(INPUT_PADDING) + text_input("", &val.to_string()) + .on_input(|_val| Event::Msg) + .padding(INPUT_PADDING) ]); } @@ -97,7 +102,11 @@ impl FormsComponent { } } -impl Component for FormsComponent { +impl Component for FormsComponent +where + Message: Clone, + Theme: 'static + text::StyleSheet + text_input::StyleSheet + button::StyleSheet, +{ type State = (); type Event = Event; @@ -118,7 +127,7 @@ impl Component for FormsComponent Element { + fn view(&self, _state: &Self::State) -> Element { let character = self.character.borrow(); let mut row = Row::new(); @@ -133,11 +142,12 @@ impl Component for FormsComponent From> for Element<'a, Message> +impl<'a, Message, Theme> From> for Element<'a, Message, Theme> where Message: 'a + Clone, + Theme: 'static + text::StyleSheet + text_input::StyleSheet + button::StyleSheet, { fn from(forms_component: FormsComponent) -> Self { - iced_lazy::component(forms_component) + component(forms_component) } } diff --git a/src/component/integrity.rs b/src/component/integrity.rs index 94d668e..44b5da4 100644 --- a/src/component/integrity.rs +++ b/src/component/integrity.rs @@ -2,11 +2,10 @@ use iced::{ widget::{column, row, text, text_input, Column}, Alignment, Length, }; -use iced_lazy::Component; use std::{cell::RefCell, rc::Rc}; -use cofd::{character::Wound, prelude::*, splat::Splat}; - +use super::list; +use crate::widget::{dots, track}; use crate::{ fl, i18n::flt, @@ -17,8 +16,8 @@ use crate::{ }, Element, COMPONENT_SPACING, H3_SIZE, INPUT_PADDING, MAX_INPUT_WIDTH, TITLE_SPACING, }; - -use super::list; +use cofd::{character::Wound, prelude::*, splat::Splat}; +use iced::widget::{component, Component}; pub struct IntegrityComponent { character: Rc>, @@ -41,11 +40,15 @@ impl IntegrityComponent { } } -impl Component for IntegrityComponent { +impl Component for IntegrityComponent +where + Theme: + text::StyleSheet + text_input::StyleSheet + dots::StyleSheet + track::StyleSheet + 'static, +{ type State = (); type Event = Event; - fn update(&mut self, _state: &mut Self::State, event: Self::Event) -> Option { + fn update(&mut self, _state: &mut Self::State, event: Event) -> Option { let mut character = self.character.borrow_mut(); match event { @@ -71,14 +74,15 @@ impl Component for IntegrityComponent { None } - fn view(&self, _state: &Self::State) -> Element { + #[allow(clippy::too_many_lines)] + fn view(&self, _state: &Self::State) -> Element { let character = self.character.borrow(); - let mut col = Column::new() + let mut col = Column::::new() .align_items(Alignment::Center) .spacing(COMPONENT_SPACING); - let dots: Element = if let Splat::Changeling(.., data) = &character.splat { + let dots: Element = if let Splat::Changeling(.., data) = &character.splat { HealthTrack::new( data.clarity.clone(), data.max_clarity(&character) as usize, @@ -100,11 +104,11 @@ impl Component for IntegrityComponent { column![text_input( "", character.touchstones.get(i).unwrap_or(&String::new()), - move |val| Event::TouchstoneChanged(i, val), ) + .on_input(move |val| Event::TouchstoneChanged(i, val)) .padding(INPUT_PADDING)] .max_width( - MAX_INPUT_WIDTH - SheetDots::::DEFAULT_SIZE, // - SheetDots::::DEFAULT_SPACING, + MAX_INPUT_WIDTH - SheetDots::::DEFAULT_SIZE, // - SheetDots::::DEFAULT_SPACING, ), ); } @@ -123,7 +127,7 @@ impl Component for IntegrityComponent { .spacing(if flag { 4 } else { - SheetDots::::DEFAULT_SPACING + SheetDots::::DEFAULT_SPACING }), ] .align_items(if flag { @@ -149,8 +153,8 @@ impl Component for IntegrityComponent { column![text_input( "", character.touchstones.first().unwrap_or(&String::new()), - |str| Event::TouchstoneChanged(0, str), ) + .on_input(|str| Event::TouchstoneChanged(0, str),) .padding(INPUT_PADDING)] .max_width(MAX_INPUT_WIDTH), ] @@ -173,8 +177,8 @@ impl Component for IntegrityComponent { column![text_input( "", character.touchstones.get(1).unwrap_or(&String::new()), - |str| Event::TouchstoneChanged(1, str), ) + .on_input(|str| Event::TouchstoneChanged(1, str),) .padding(INPUT_PADDING)] .max_width(MAX_INPUT_WIDTH), ] @@ -190,11 +194,10 @@ impl Component for IntegrityComponent { Some(10), character.touchstones.clone() as Vec, |i, val| { - text_input("", &val.unwrap_or_default(), move |val| { - Event::TouchstoneChanged(i, val) - }) - .padding(INPUT_PADDING) - .into() + text_input("", &val.unwrap_or_default()) + .on_input(move |val| Event::TouchstoneChanged(i, val)) + .padding(INPUT_PADDING) + .into() }, ) .max_width(MAX_INPUT_WIDTH), @@ -207,11 +210,13 @@ impl Component for IntegrityComponent { } } -impl<'a, Message> From for Element<'a, Message> +impl<'a, Message, Theme> From for Element<'a, Message, Theme> where Message: 'a, + Theme: + text::StyleSheet + text_input::StyleSheet + dots::StyleSheet + track::StyleSheet + 'static, { fn from(integrity: IntegrityComponent) -> Self { - iced_lazy::component(integrity) + component(integrity) } } diff --git a/src/component/merits.rs b/src/component/merits.rs index 604d345..6fb47a3 100644 --- a/src/component/merits.rs +++ b/src/component/merits.rs @@ -2,17 +2,17 @@ use iced::{ widget::{column, pick_list, row, text, text_input, Column}, Alignment, Length, }; -use iced_lazy::Component; use std::{cell::RefCell, rc::Rc}; -use cofd::{prelude::*, splat::Merit}; - +use crate::widget::dots; use crate::{ fl, i18n::{flt, Translated}, widget::dots::{Shape, SheetDots}, Element, H3_SIZE, INPUT_PADDING, TITLE_SPACING, }; +use cofd::{prelude::*, splat::Merit}; +use iced::widget::{component, container, overlay, scrollable, Component}; pub struct MeritComponent { character: Rc>, @@ -41,11 +41,22 @@ impl MeritComponent { } } -impl Component for MeritComponent { +impl Component for MeritComponent +where + Theme: text::StyleSheet + + dots::StyleSheet + + text_input::StyleSheet + + pick_list::StyleSheet + + scrollable::StyleSheet + + overlay::menu::StyleSheet + + container::StyleSheet + + 'static, + ::Style: From<::Style>, +{ type State = (); type Event = Event; - fn update(&mut self, _state: &mut Self::State, event: Self::Event) -> Option { + fn update(&mut self, _state: &mut Self::State, event: Event) -> Option { if let Merit::_Custom(str) = &event.1 { if str.contains("---") { return None; @@ -55,7 +66,7 @@ impl Component for MeritComponent { Some((self.on_change)(event.0, event.1, event.2)) } - fn view(&self, _state: &Self::State) -> Element { + fn view(&self, _state: &Self::State) -> Element { let character = self.character.borrow(); let mut col1 = Column::new().spacing(3).width(Length::FillPortion(3)); @@ -87,28 +98,33 @@ impl Component for MeritComponent { let skills = &character.skills(); let vec: Vec> = vec - .iter().filter(|&e| { + .iter() + .filter(|&e| { character .merits .iter() .filter(|(merit, _)| *merit == *e) .count() == 0 && e.is_available(&character, attributes, skills) - }).cloned() + }) + .cloned() .map(Into::into) .collect(); for (i, (merit, val)) in character.merits.iter().cloned().enumerate() { if let Merit::_Custom(str) = &merit { col1 = col1.push( - text_input("", str, move |key| Event(i, Merit::_Custom(key), val)) + text_input("", str) + .on_input(move |key| Event(i, Merit::_Custom(key), val)) .padding(INPUT_PADDING), ); } else { col1 = col1 .push( - pick_list(vec.clone(), Some(merit.clone().into()), move |key| { - Event(i, key.unwrap(), val) - }) + pick_list( + vec.clone(), + Some::>(merit.clone().into()), + move |key| Event(i, key.unwrap(), val), + ) .padding(INPUT_PADDING) .text_size(20) .width(Length::Fill), @@ -122,7 +138,7 @@ impl Component for MeritComponent { })); } - let new = pick_list(vec, None, |key| { + let new = pick_list(vec, None::>, |key| { Event(self.character.borrow().merits.len(), key.unwrap(), 0) }) .padding(INPUT_PADDING) @@ -139,11 +155,20 @@ impl Component for MeritComponent { } } -impl<'a, Message> From> for Element<'a, Message> +impl<'a, Message, Theme> From> for Element<'a, Message, Theme> where Message: 'a, + Theme: text::StyleSheet + + dots::StyleSheet + + text_input::StyleSheet + + pick_list::StyleSheet + + scrollable::StyleSheet + + overlay::menu::StyleSheet + + container::StyleSheet + + 'static, + ::Style: From<::Style>, { fn from(info_bar: MeritComponent) -> Self { - iced_lazy::component(info_bar) + component(info_bar) } } diff --git a/src/component/mod.rs b/src/component/mod.rs index 9df6504..10e40a1 100644 --- a/src/component/mod.rs +++ b/src/component/mod.rs @@ -1,17 +1,17 @@ mod attributes; -// mod forms; +mod forms; mod info; -// mod integrity; +mod integrity; mod list; -// mod merits; +mod merits; mod skills; -// mod traits; +mod traits; pub use attributes::{attribute_bar, AttributeBar}; -// pub use forms::{forms_component, FormsComponent}; +pub use forms::{forms_component, FormsComponent}; pub use info::{info_bar, InfoBar}; -// pub use integrity::{integrity_component, IntegrityComponent}; +pub use integrity::{integrity_component, IntegrityComponent}; pub use list::{list, List}; -// pub use merits::{merit_component, MeritComponent}; +pub use merits::{merit_component, MeritComponent}; pub use skills::{skills_component, SkillsComponent}; -// pub use traits::{traits_component, TraitsComponent}; +pub use traits::{traits_component, TraitsComponent}; diff --git a/src/component/traits.rs b/src/component/traits.rs index 528f443..c4fe463 100644 --- a/src/component/traits.rs +++ b/src/component/traits.rs @@ -1,23 +1,17 @@ +use crate::{fl, i18n::flt, Element, INPUT_PADDING}; +use cofd::{character::ArmorStruct, prelude::*}; +use iced::widget::{component, Component}; use iced::{ widget::{column, row, text, text_input}, Length, }; -use iced_lazy::Component; - -use cofd::{character::ArmorStruct, prelude::*}; - -use crate::{ - fl, - i18n::flt, - Element, INPUT_PADDING, -}; struct Traits { size: u16, speed: u16, defense: u16, armor: ArmorStruct, - initative: u16, + initiative: u16, beats: u16, alternate_beats: u16, alternate_experience: u16, @@ -50,7 +44,7 @@ impl TraitsComponent { size: character.size(), speed: character.speed(), defense: character.defense(), - initative: character.initative(), + initiative: character.initative(), beats: character.beats, experience: character.experience(), alternate_beats: character.alternate_beats, @@ -66,46 +60,47 @@ impl TraitsComponent { } } -impl Component for TraitsComponent { +impl Component for TraitsComponent +where + Theme: text::StyleSheet + text_input::StyleSheet + 'static, +{ type State = (); type Event = Event; - fn update(&mut self, _state: &mut Self::State, event: Self::Event) -> Option { + fn update(&mut self, _state: &mut Self::State, event: Event) -> Option { Some((self.on_change)(event.0, event.1)) } - fn view(&self, _state: &Self::State) -> Element { + fn view(&self, _state: &Self::State) -> Element { let beats = row![ text(format!("{}:", fl!("beats"))), - text_input("", &format!("{}", self.traits.beats), |val| { - Event(val.parse().unwrap_or(0), Trait::Beats) - }) - .padding(INPUT_PADDING) + text_input("", &format!("{}", self.traits.beats)) + .on_input(|val| { Event(val.parse().unwrap_or(0), Trait::Beats) }) + .padding(INPUT_PADDING) ]; - let alternate_beats = if !self.traits.alt_opt { + let alternate_beats = if self.traits.alt_opt { + row![] + } else { row![ text(format!( "{}:", flt(&self.traits.splat, Some("beats")).unwrap() )), - text_input("", &format!("{}", self.traits.alternate_beats), |val| { - Event(val.parse().unwrap_or(0), Trait::AlternateBeats) - }) - .padding(INPUT_PADDING) + text_input("", &format!("{}", self.traits.alternate_beats)) + .on_input(|val| { Event(val.parse().unwrap_or(0), Trait::AlternateBeats) }) + .padding(INPUT_PADDING) ] - } else { - row![] }; - let alternate_xp = if !self.traits.alt_opt { + let alternate_xp = if self.traits.alt_opt { + row![] + } else { row![text(format!( "{}: {}", flt(&self.traits.splat, Some("experience")).unwrap(), self.traits.alternate_experience )),] - } else { - row![] }; column![ @@ -143,7 +138,7 @@ impl Component for TraitsComponent { // }) ], row![ - text(format!("{}: {}", fl!("initative"), self.traits.initative)), + text(format!("{}: {}", fl!("initative"), self.traits.initiative)), // text(self.traits.initative) ], beats, @@ -160,11 +155,12 @@ impl Component for TraitsComponent { } } -impl<'a, Message> From> for Element<'a, Message> +impl<'a, Message, Theme> From> for Element<'a, Message, Theme> where Message: 'a, + Theme: text::StyleSheet + text_input::StyleSheet + 'static, { - fn from(info_bar: TraitsComponent) -> Self { - iced_lazy::component(info_bar) + fn from(traits_component: TraitsComponent) -> Self { + component(traits_component) } } diff --git a/src/main.rs b/src/main.rs index 142b1ce..5cfb5dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -240,19 +240,16 @@ impl Application for PlayerCompanionApp { let tab: Element = match active_tab { Tab::Overview => view::overview_tab(character.clone()).into(), - _ => { - todo!() - } // Tab::Equipment => view::equipment_tab(character.clone()).into(), - - // Tab::Forms => { - // if let Splat::Werewolf(_, _, _, _) = brw.splat { - // view::werewolf::form_tab(character.clone(), Message::Msg).into() - // } else { - // unreachable!() - // } - // } - - // Tab::SplatExtras => view::splat_extras_tab(character.clone()).into(), + Tab::Equipment => view::equipment_tab(character.clone()).into(), + + // Tab::Forms => { + // if let Splat::Werewolf(_, _, _, _) = brw.splat { + // view::werewolf::form_tab(character.clone(), Message::Msg).into() + // } else { + // unreachable!() + // } + // } + Tab::SplatExtras => view::splat_extras_tab(character.clone()).into(), }; // let mut row = row![ diff --git a/src/view/character_list.rs b/src/view/character_list.rs index 2e6be57..a295aa2 100644 --- a/src/view/character_list.rs +++ b/src/view/character_list.rs @@ -1,4 +1,4 @@ -use std::{cell::RefCell, marker::PhantomData, rc::Rc}; +use std::{cell::RefCell, rc::Rc}; use crate::i18n::flt; use cofd::prelude::*; @@ -10,8 +10,6 @@ use iced::{ pub struct CharacterList { characters: Vec>>, on_pick: Box Message + 'static>, - - phantom: PhantomData, } pub fn character_list( @@ -33,7 +31,6 @@ impl CharacterList { ) -> Self { Self { characters, - phantom: PhantomData, on_pick: Box::new(on_pick), } } @@ -83,9 +80,7 @@ where } fn view(&self, _state: &Self::State) -> Element<'_, Event, Theme> { - let mut list = Column::new() - .width(Length::FillPortion(4)) - .spacing(5); + let mut list = Column::new().width(Length::FillPortion(4)).spacing(5); for (i, character) in self.characters.iter().enumerate() { list = list.push(self.mk_char(i, &character.borrow())); diff --git a/src/view/creator.rs b/src/view/creator.rs index e7161d3..6a70f89 100644 --- a/src/view/creator.rs +++ b/src/view/creator.rs @@ -1,6 +1,6 @@ use cofd::{prelude::*, splat::Splat}; use iced::overlay::menu; -use iced::widget::{container, overlay, scrollable, Column, Row}; +use iced::widget::{container, scrollable}; use iced::{ widget::{button, column, component, pick_list, row, text, Component}, Element, Length, @@ -21,7 +21,7 @@ pub fn creator_view( #[derive(Clone)] pub enum Event { - SplatChanged(Splat), + SplatChanged(Splat), // TODO: Switch to using a unit-varianted "SplatKind" enum here Done, } diff --git a/src/view/equipment.rs b/src/view/equipment.rs index dd966c8..15f2af2 100644 --- a/src/view/equipment.rs +++ b/src/view/equipment.rs @@ -1,15 +1,14 @@ +use std::{cell::RefCell, marker::PhantomData, rc::Rc}; + +use super::overview::vec_changed; +use crate::{Element, H2_SIZE, TITLE_SPACING}; use closure::closure; +use cofd::{character::Weapon, prelude::*}; +use iced::widget::{component, Component}; use iced::{ widget::{column, row, text, text_input}, Alignment, Length, }; -use iced_lazy::Component; -use std::{cell::RefCell, marker::PhantomData, rc::Rc}; - -use cofd::{character::Weapon, prelude::*}; - -use super::overview::vec_changed; -use crate::{Element, H2_SIZE, TITLE_SPACING}; pub struct EquipmentTab { character: Rc>, @@ -38,15 +37,16 @@ impl EquipmentTab { } } -impl Component for EquipmentTab +impl Component for EquipmentTab where Message: Clone, + Theme: text::StyleSheet + text_input::StyleSheet + 'static, { type State = (); type Event = Event; - fn update(&mut self, _state: &mut Self::State, event: Self::Event) -> Option { + fn update(&mut self, _state: &mut Self::State, event: Event) -> Option { let mut character = self.character.borrow_mut(); match event { @@ -63,7 +63,7 @@ where } #[allow(clippy::too_many_lines)] - fn view(&self, _state: &Self::State) -> Element { + fn view(&self, _state: &Self::State) -> Element { let character = self.character.borrow(); let weapons = { @@ -96,45 +96,35 @@ where vec.push(Default::default()); for (i, weapon) in vec.into_iter().enumerate() { - name = name.push(text_input( - "", - &weapon.name, + name = name.push(text_input("", &weapon.name).on_input( closure!(clone weapon, |val| { let mut weapon = weapon.clone(); weapon.name = val; Event::WeaponChanged(i, weapon) }), )); - pool = pool.push(text_input( - "", - &weapon.dice_pool, + pool = pool.push(text_input("", &weapon.dice_pool).on_input( closure!(clone weapon, |val| { let mut weapon = weapon.clone(); weapon.dice_pool = val; Event::WeaponChanged(i, weapon) }), )); - damage = damage.push(text_input( - "", - &weapon.damage, + damage = damage.push(text_input("", &weapon.damage).on_input( closure!(clone weapon, |val| { let mut weapon = weapon.clone(); weapon.damage = val; Event::WeaponChanged(i, weapon) }), )); - range = range.push(text_input( - "", - &weapon.range, + range = range.push(text_input("", &weapon.range).on_input( closure!(clone weapon, |val| { let mut weapon = weapon.clone(); weapon.range = val; Event::WeaponChanged(i, weapon) }), )); - initative = initative.push(text_input( - "", - &weapon.initative.to_string(), + initative = initative.push(text_input("", &weapon.initative.to_string()).on_input( closure!(clone weapon, |val| { let mut weapon = weapon.clone(); if let Ok(val) = val.parse() { @@ -143,9 +133,7 @@ where Event::WeaponChanged(i, weapon) }), )); - size = size.push(text_input( - "", - &weapon.size.to_string(), + size = size.push(text_input("", &weapon.size.to_string()).on_input( closure!(clone weapon, |val| { let mut weapon = weapon.clone(); if let Ok(val) = val.parse() { @@ -175,6 +163,6 @@ where Message: 'a + Clone, { fn from(equipment_tab: EquipmentTab) -> Self { - iced_lazy::component(equipment_tab) + component(equipment_tab) } } diff --git a/src/view/mod.rs b/src/view/mod.rs index 4ee46fe..bc53559 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -1,11 +1,11 @@ mod character_list; mod creator; -// mod equipment; +mod equipment; mod overview; -// mod splat_extras; +mod splat_extras; pub use character_list::{character_list, CharacterList}; pub use creator::{creator_view, CreatorView}; -// pub use equipment::{equipment_tab, EquipmentTab}; +pub use equipment::{equipment_tab, EquipmentTab}; pub use overview::{overview_tab, OverviewTab}; -// pub use splat_extras::{splat_extras_tab, SplatExtrasTab}; +pub use splat_extras::{splat_extras_tab, SplatExtrasTab}; diff --git a/src/view/overview.rs b/src/view/overview.rs index a7e9fbe..ba9527c 100644 --- a/src/view/overview.rs +++ b/src/view/overview.rs @@ -19,22 +19,15 @@ use iced::{ Alignment, Element, Length, }; -use crate::widget::{dots, track}; use crate::{ - component::{attribute_bar, info_bar, list, skills_component}, - // component::{ - // attribute_bar, info_bar, integrity_component, list, merit_component, skills_component, - // traits_component, - // }, + component::{ + attribute_bar, info_bar, integrity_component, list, merit_component, skills_component, + traits_component, + }, fl, i18n::{flt, Translated}, - widget::{dots::Shape, dots::SheetDots, track::HealthTrack}, - COMPONENT_SPACING, - H2_SIZE, - H3_SIZE, - INPUT_PADDING, - MAX_INPUT_WIDTH, - TITLE_SPACING, + widget::{dots, dots::Shape, dots::SheetDots, track, track::HealthTrack}, + COMPONENT_SPACING, H2_SIZE, H3_SIZE, INPUT_PADDING, MAX_INPUT_WIDTH, TITLE_SPACING, }; pub struct OverviewTab { @@ -457,7 +450,7 @@ where column![] }; - // let integrity = integrity_component(self.character.clone()); + let integrity = integrity_component(self.character.clone()); let conditions = list( fl!("conditions"), @@ -584,8 +577,8 @@ where }; let abilities = self.abilities(&character); - // let merits = merit_component(self.character.clone(), Event::MeritChanged); - // let traits = traits_component(&character, Event::TraitChanged); + let merits = merit_component(self.character.clone(), Event::MeritChanged); + let traits = traits_component(&character, Event::TraitChanged); let regalia = if let Splat::Changeling(seeming, .., data) = &character.splat { let sg = seeming.get_favored_regalia(); @@ -735,50 +728,50 @@ where } } - // col2 = col2.push(integrity); + col2 = col2.push(integrity); match &character.splat { Splat::Vampire(..) => { col1 = col1 .push(abilities) - // .push(merits) + .push(merits) .push(aspirations) .push(banes) .push(conditions); - // col2 = col2.push(traits); + col2 = col2.push(traits); } Splat::Werewolf(..) => { col1 = col1 - // .push(merits) + .push(merits) .push(abilities) .push(aspirations) .push(hunters_aspect) - .push(conditions); - // .push(traits); + .push(conditions) + .push(traits); col2 = col2.push(kuruth_triggers); } Splat::Mage(..) => { - // col1 = col1.push(abilities).push(merits).push(traits); + col1 = col1.push(abilities).push(merits).push(traits); col2 = col2.push(conditions).push(aspirations).push(obsessions); } Splat::Changeling(..) => { col1 = col1 - // .push(merits) + .push(merits) .push(regalia) .push(frailties) .push(aspirations) .push(conditions); - // col2 = col2.push(traits); + col2 = col2.push(traits); } Splat::Bound(..) => { col1 = col1 - // .push(merits) + .push(merits) // Keys .push(abilities); col2 = col2.push(aspirations); } _ => { - // col1 = col1.push(merits).push(traits); + col1 = col1.push(merits).push(traits); col2 = col2.push(conditions).push(aspirations); } } diff --git a/src/view/splat_extras.rs b/src/view/splat_extras.rs index e056665..b347eeb 100644 --- a/src/view/splat_extras.rs +++ b/src/view/splat_extras.rs @@ -2,9 +2,16 @@ use iced::{ widget::{checkbox, column, pick_list, row, text, text_input, Column}, Alignment, Length, }; -use iced_lazy::Component; use std::{cell::RefCell, rc::Rc}; +use crate::component::{forms_component, list}; +use crate::widget::dots; +use crate::{ + fl, + i18n::{flt, Translated}, + widget::dots::{Shape, SheetDots}, + Element, H2_SIZE, H3_SIZE, INPUT_PADDING, TITLE_SPACING, +}; use cofd::{ prelude::*, splat::{ @@ -14,14 +21,7 @@ use cofd::{ Splat, }, }; - -use crate::{ - // component::{self, list}, - fl, - i18n::{flt, Translated}, - widget::dots::{Shape, SheetDots}, - Element, H2_SIZE, H3_SIZE, INPUT_PADDING, TITLE_SPACING, -}; +use iced::widget::{button, component, container, overlay, scrollable, Component}; fn func( c: C, @@ -67,9 +67,21 @@ impl SplatExtrasTab { } } -impl Component for SplatExtrasTab +impl Component for SplatExtrasTab where Message: Clone, + Theme: 'static + + text::StyleSheet + + text_input::StyleSheet + + pick_list::StyleSheet + + scrollable::StyleSheet + + overlay::menu::StyleSheet + + container::StyleSheet + + dots::StyleSheet + + checkbox::StyleSheet + + button::StyleSheet + + 'static, + ::Style: From<::Style>, { type State = (); @@ -108,13 +120,15 @@ where Event::Msg => {} Event::RiteChanged(i, val) => { if let Splat::Werewolf(.., data) = &mut character.splat { - if let Rite::_Custom(name) = &val && name.eq("") { + if let Rite::_Custom(name) = &val + && name.eq("") + { data.rites.remove(i); } else if let Some(m) = data.rites.get_mut(i) { - *m = val; - } else { - data.rites.push(val); - } + *m = val; + } else { + data.rites.push(val); + } } } Event::ContractChanged(i, rote) => { @@ -129,11 +143,11 @@ where } #[allow(clippy::too_many_lines)] - fn view(&self, _state: &Self::State) -> Element { + fn view(&self, _state: &Self::State) -> Element { let character = self.character.borrow(); - let rotes: Element = if let Splat::Mage(.., data) = &character.splat { - let col = |txt, ratio| -> Column { + let rotes: Element = if let Splat::Mage(.., data) = &character.splat { + let col = |txt, ratio| -> Column { column![text(txt)] .align_items(Alignment::Center) .width(Length::FillPortion(ratio)) @@ -153,7 +167,7 @@ where arcanum = arcanum.push( pick_list( arcana.clone(), - Some(rote.arcanum.clone().into()), + Some::>(rote.arcanum.clone().into()), func( rote.clone(), |rote, val: Translated| rote.arcanum = val.unwrap(), @@ -162,37 +176,25 @@ where ) .width(Length::Fill), ); - level = level.push(text_input( - "", - &rote.level.to_string(), - func( - rote.clone(), - |rote, val: String| rote.level = val.parse().unwrap_or(rote.level), - move |rote| Event::RoteChanged(i, rote), - ), - )); - spell = spell.push(text_input( - "", - &rote.spell, - func( - rote.clone(), - |rote, val| rote.spell = val, - move |rote| Event::RoteChanged(i, rote), - ), - )); - creator = creator.push(text_input( - "", - &rote.creator, - func( - rote.clone(), - |rote, val| rote.creator = val, - move |rote| Event::RoteChanged(i, rote), - ), - )); + level = level.push(text_input("", &rote.level.to_string()).on_input(func( + rote.clone(), + |rote, val: String| rote.level = val.parse().unwrap_or(rote.level), + move |rote| Event::RoteChanged(i, rote), + ))); + spell = spell.push(text_input("", &rote.spell).on_input(func( + rote.clone(), + |rote, val| rote.spell = val, + move |rote| Event::RoteChanged(i, rote), + ))); + creator = creator.push(text_input("", &rote.creator).on_input(func( + rote.clone(), + |rote, val| rote.creator = val, + move |rote| Event::RoteChanged(i, rote), + ))); rote_skill = rote_skill.push( pick_list( skills.clone(), - Some(rote.skill.into()), + Some::>(rote.skill.into()), func( rote.clone(), |rote, val: Translated| rote.skill = val.unwrap(), @@ -214,7 +216,7 @@ where column![].into() }; - let forms = component::forms_component(self.character.clone(), Event::Msg); + let forms = forms_component(self.character.clone(), Event::Msg); let gifts = if let Splat::Werewolf(auspice, _, _, data) = &character.splat { let shadow_gifts: Vec> = ShadowGift::all() @@ -236,9 +238,11 @@ where { let shadow_gifts = shadow_gifts; move |i, val| { - pick_list(shadow_gifts.clone(), val.map(Into::into), move |val| { - Event::ShadowGiftChanged(i, val.unwrap()) - }) + pick_list( + shadow_gifts.clone(), + val.map(Into::>::into), + move |val| Event::ShadowGiftChanged(i, val.unwrap()), + ) .padding(INPUT_PADDING) .into() } @@ -253,9 +257,11 @@ where { let wolf_gifts = wolf_gifts; move |i, val| { - pick_list(wolf_gifts.clone(), val.map(Into::into), move |val| { - Event::WolfGiftChanged(i, val.unwrap()) - }) + pick_list( + wolf_gifts.clone(), + val.map(Into::>::into), + move |val| Event::WolfGiftChanged(i, val.unwrap()), + ) .padding(INPUT_PADDING) .into() } @@ -301,14 +307,13 @@ where { move |i, rite| { if let Some(Rite::_Custom(name)) = rite { - text_input("", &name, move |val| { - Event::RiteChanged(i, Rite::_Custom(val)) - }) - .into() + text_input("", &name) + .on_input(move |val| Event::RiteChanged(i, Rite::_Custom(val))) + .into() } else { pick_list( vec![Rite::_Custom(fl!("custom")).into()], - rite.map(Into::into), + rite.map(Into::>::into), move |val: Translated| Event::RiteChanged(i, val.unwrap()), ) .padding(INPUT_PADDING) @@ -324,7 +329,7 @@ where }; let contracts = if let Splat::Changeling(.., data) = &character.splat { - let col = |txt, ratio| -> Column { + let col = |txt, ratio| -> Column { column![text(txt)] .align_items(Alignment::Center) .width(Length::FillPortion(ratio)) @@ -341,78 +346,47 @@ where let mut seeming_benefit = col("Seeming Benefit", 3); for (i, contract) in data.contracts.iter().enumerate() { - name = name.push(text_input( - "", - &contract.name, - func( - contract.clone(), - |contract, val| contract.name = val, - move |val| Event::ContractChanged(i, val), - ), - )); - goblin = goblin.push(checkbox( - "", - contract.goblin, - func( - contract.clone(), - |contract, val| contract.goblin = val, - move |val| Event::ContractChanged(i, val), - ), - )); - cost = cost.push(text_input( - "", - &contract.cost, - func( - contract.clone(), - |contract, val| contract.cost = val, - move |val| Event::ContractChanged(i, val), - ), - )); - dice = dice.push(text_input( - "", - &contract.dice, - func( - contract.clone(), - |contract, val| contract.dice = val, - move |val| Event::ContractChanged(i, val), - ), - )); - action = action.push(text_input( - "", - &contract.action, - func( - contract.clone(), - |contract, val| contract.action = val, - move |val| Event::ContractChanged(i, val), - ), - )); - duration = duration.push(text_input( - "", - &contract.duration, - func( - contract.clone(), - |contract, val| contract.duration = val, - move |val| Event::ContractChanged(i, val), - ), - )); - loophole = loophole.push(text_input( - "", - &contract.loophole, - func( - contract.clone(), - |contract, val| contract.loophole = val, - move |val| Event::ContractChanged(i, val), - ), - )); - seeming_benefit = seeming_benefit.push(text_input( - "", - &contract.seeming_benefit, - func( + name = name.push(text_input("", &contract.name).on_input(func( + contract.clone(), + |contract, val| contract.name = val, + move |val| Event::ContractChanged(i, val), + ))); + goblin = goblin.push(checkbox("", contract.goblin).on_toggle(func( + contract.clone(), + |contract, val| contract.goblin = val, + move |val| Event::ContractChanged(i, val), + ))); + cost = cost.push(text_input("", &contract.cost).on_input(func( + contract.clone(), + |contract, val| contract.cost = val, + move |val| Event::ContractChanged(i, val), + ))); + dice = dice.push(text_input("", &contract.dice).on_input(func( + contract.clone(), + |contract, val| contract.dice = val, + move |val| Event::ContractChanged(i, val), + ))); + action = action.push(text_input("", &contract.action).on_input(func( + contract.clone(), + |contract, val| contract.action = val, + move |val| Event::ContractChanged(i, val), + ))); + duration = duration.push(text_input("", &contract.duration).on_input(func( + contract.clone(), + |contract, val| contract.duration = val, + move |val| Event::ContractChanged(i, val), + ))); + loophole = loophole.push(text_input("", &contract.loophole).on_input(func( + contract.clone(), + |contract, val| contract.loophole = val, + move |val| Event::ContractChanged(i, val), + ))); + seeming_benefit = + seeming_benefit.push(text_input("", &contract.seeming_benefit).on_input(func( contract.clone(), |contract, val| contract.seeming_benefit = val, move |val| Event::ContractChanged(i, val), - ), - )); + ))); } column![ @@ -463,6 +437,6 @@ where Message: 'a + Clone, { fn from(splat_extras_tab: SplatExtrasTab) -> Self { - iced_lazy::component(splat_extras_tab) + component(splat_extras_tab) } }