restructure stuff, add builtin_container feature

This commit is contained in:
griffi-gh 2024-02-19 23:13:35 +01:00
parent 250e821396
commit e9cfd19c01
3 changed files with 19 additions and 12 deletions

View file

@ -29,8 +29,10 @@ document-features = "0.2"
default = ["builtin_elements", "builtin_font", "pixel_perfect"] default = ["builtin_elements", "builtin_font", "pixel_perfect"]
## Enable the built-in font (ProggyTiny, adds 35kb to the executable) ## Enable the built-in font (ProggyTiny, adds 35kb to the executable)
builtin_font = [] builtin_font = []
## Enable the built-in elements (`Container`, `ProgressBar`, etc.) ## Enable the built-in elements (`Container`, `ProgressBar`, etc.)\
builtin_elements = [] builtin_elements = ["builtin_container"]
## Enable only the `Container` component (which is essential for laying out other components)
builtin_container = []
## Round vertex positions to nearest integer coordinates (fixes blurry text) ## Round vertex positions to nearest integer coordinates (fixes blurry text)
pixel_perfect = [] pixel_perfect = []

View file

@ -7,16 +7,7 @@ use crate::{
LayoutInfo LayoutInfo
}; };
#[cfg(feature = "builtin_elements")] mod builtin;
mod builtin {
pub mod rect;
pub mod container;
pub mod spacer;
pub mod progress_bar;
pub mod text;
}
#[cfg(feature = "builtin_elements")]
pub use builtin::*; pub use builtin::*;
pub struct MeasureContext<'a> { pub struct MeasureContext<'a> {

View file

@ -0,0 +1,14 @@
#[cfg(feature = "builtin_container")]
pub mod container;
#[cfg(feature = "builtin_elements")]
pub mod rect;
#[cfg(feature = "builtin_elements")]
pub mod spacer;
#[cfg(feature = "builtin_elements")]
pub mod progress_bar;
#[cfg(feature = "builtin_elements")]
pub mod text;