pub struct KitData {
pub name: String,
pub label: Option<String>,
pub theme: TokenFile,
pub counterpart: Option<KitVariant>,
pub fonts: Vec<KitFont>,
pub license: Option<String>,
pub origin: Origin,
/* private fields */
}Expand description
A kit’s data: its tokens (a theme), its faces and its licence, with
what was wrong reading them. A kit with code adds its handlers
around it (egui_pop_core::kit::KitSource).
Fields§
§name: StringIts theme’s name; the theme picker lists it under it.
label: Option<String>A name for people, from the manifest.
theme: TokenFileThe kit’s tokens: a theme named KitData::name.
counterpart: Option<KitVariant>The kit’s other variant, light or dark, when its manifest gives
one (counterpart): a theme of its own, each naming the other as
its counterpart.
fonts: Vec<KitFont>§license: Option<String>§origin: OriginImplementations§
Source§impl KitData
impl KitData
Sourcepub fn load(dir: impl AsRef<Path>) -> KitData
pub fn load(dir: impl AsRef<Path>) -> KitData
Reads a kit folder (see the module). Never fails: what could not
be read is in KitData::problems.
Its YAML files go through the default cache (crate::cache):
read again unchanged, they are not parsed again.
Sourcepub fn load_with(dir: impl AsRef<Path>, cache: &Cache) -> KitData
pub fn load_with(dir: impl AsRef<Path>, cache: &Cache) -> KitData
KitData::load through a given cache (crate::cache::Cache).
An entry that cannot be written is a Problem::NotCached: the
kit is read all the same.
Sourcepub fn from_text(name: &str, kit_text: &str) -> KitData
pub fn from_text(name: &str, kit_text: &str) -> KitData
A data-only kit from the text of its kit.yaml (or kit.json),
under a name (the manifest’s wins).
Sourcepub fn problems(&self) -> &[Problem]
pub fn problems(&self) -> &[Problem]
What was wrong reading the kit, in the order met; empty for a
clean kit. check adds the problems of the theme it resolves to.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
The kit’s name for people: its label, else its name.
Sourcepub fn infos(&self) -> Vec<KitInfo>
pub fn infos(&self) -> Vec<KitInfo>
The kit and its other variant, if it has one, as a theme picker lists them: a theme each.
Sourcepub fn info(&self) -> KitInfo
pub fn info(&self) -> KitInfo
The kit as a theme picker lists it (its own variant; see
KitData::infos).