♻️ Refactor core for minimal PageTop setup

This commit is contained in:
Manuel Cillero 2024-11-30 22:15:06 +01:00
parent 2b229573cd
commit 556c9159d3
64 changed files with 192 additions and 6561 deletions

View file

@ -0,0 +1,25 @@
use crate::prelude::*;
#[derive(AutoDefault)]
pub struct Fluent(L10n);
impl ComponentTrait for Fluent {
fn new() -> Self {
Fluent::default()
}
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
PrepareMarkup::With(self.0.escaped(cx.langid()))
}
}
impl Fluent {
pub fn with(l10n: L10n) -> Self {
Fluent(l10n)
}
pub fn set_l10n(&mut self, l10n: L10n) -> &mut Self {
self.0 = l10n;
self
}
}