Skip to main content

ferroui_themes_fluent/
lib.rs

1//! ferroui-themes-fluent
2//!
3//! The Fluent theme: the control themes of the control set, the colour
4//! palettes and the resources they use, in a light and a dark variant and
5//! in a normal and a compact density.
6//!
7//! The theme is markup: `FluentTheme.xaml` (the document of the
8//! [`FluentTheme`] class), `Accents/*.xaml` (palette, resources and
9//! brushes), `DensityStyles/Compact.xaml`, `Strings/InvariantResources.xaml`,
10//! `Controls/FluentControls.xaml` (the list of the control themes) and one
11//! document per control under `Controls/`. The documents
12//! belong to the assembly `FerroUI.Themes.Fluent`, with the URIs
13//! `ferres://FerroUI.Themes.Fluent/<path>`. They are compiled into the crate,
14//! as upstream's compiler compiles them, and are not embedded as assets: a
15//! load by URI goes to the loader table of the compiled markup, which
16//! answers the public document `FluentTheme.xaml` (see `build.rs`).
17//!
18//! ```ignore
19//! application.styles().add(FluentTheme::new().as_style());
20//! ```
21
22#[path = "Accents/mod.rs"]
23pub mod accents;
24mod assets;
25mod color_palette_resources;
26mod color_palette_resources_collection;
27// `compiled_xaml`, the compiled markup of the theme: generated by the build script of the
28// crate from the documents of [`FluentTheme`], against the type models of this crate and of
29// the crates it is built on (docs/porting/xaml.md, 9.5.13). The checked-in `compiled_xaml.rs`
30// is the reference `tests/compiled_xaml_tests.rs` compares the output of the build with, byte
31// for byte; it is not a module of the crate. (`compiled_markup`, which the same file declares,
32// is not used: the theme registers its assets and its loader table itself.)
33ferroui_markup_xaml::include_compiled_xaml!();
34mod fluent_theme;
35mod register_types;
36mod rust_paths;
37
38pub use assets::{excluded_documents, ExcludedDocument};
39pub use color_palette_resources::ColorPaletteResources;
40pub use color_palette_resources_collection::ColorPaletteResourcesCollection;
41pub use fluent_theme::{DensityStyle, FluentTheme};
42pub use register_types::{register_types, ASSEMBLY};
43
44#[cfg(test)]
45mod tests;