♻️ Refactor core for minimal PageTop setup
This commit is contained in:
parent
2b229573cd
commit
556c9159d3
64 changed files with 192 additions and 6561 deletions
25
src/base/component/fluent.rs
Normal file
25
src/base/component/fluent.rs
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue