pub struct Style {Show 26 fields
pub w: Units,
pub h: Units,
pub min_w: f32,
pub min_h: f32,
pub flex: f32,
pub dock: Dock,
pub gap: f32,
pub pad: [f32; 4],
pub margin: [f32; 4],
pub cell: Cell,
pub halign: Option<HAlign>,
pub valign: Option<VAlign>,
pub bg: u32,
pub color: u32,
pub align: Align,
pub font_scale: f32,
pub text_shadow: bool,
pub focus_style: FocusStyle,
pub focus_color: u32,
pub no_wrap: bool,
pub pos: Option<(f32, f32)>,
pub ellipsis: bool,
pub clip: bool,
pub scroll_y: f32,
pub scrollbar: bool,
pub font: String,
}Expand description
Visual and layout style for a widget.
Fields§
§w: Units§h: Units§min_w: f32§min_h: f32§flex: f32§dock: Dock§gap: f32§pad: [f32; 4]§margin: [f32; 4]§cell: Cell§halign: Option<HAlign>Horizontal placement in its slot (grid cell, or a Column’s width) —
see HAlign. None = the parent’s default.
valign: Option<VAlign>Vertical placement in its slot (grid cell, or a Row’s height) — see
VAlign. None = the parent’s default.
bg: u32§color: u32§align: Align§font_scale: f32§text_shadow: bool§focus_style: FocusStyle§focus_color: u32§no_wrap: boolLabels/buttons: never word-wrap, even if narrower than the text. For single-line titles/headers that must stay on one line — matches Patchouli, where such text overflows its box horizontally rather than wrapping onto a second line.
pos: Option<(f32, f32)>Absolute position (x, y) inside the parent’s content box (inside its
padding) — WPF Canvas / WinForms Location style. A positioned
widget is taken out of the parent’s flex flow: it takes no main-axis
space, ignores flex/dock, and is drawn in tree order (later
siblings on top). None (default) = normal flex positioning.
ellipsis: boolLabels/buttons: a single line (implies no_wrap) cut with ... when
wider than the box, instead of overflowing it.
clip: boolContainers: children are drawn (and hit) only inside this widget’s rect — anything scrolled or overflowing past it is cut off.
scroll_y: f32Containers: vertical scroll offset of the children in GUI pixels
(0 = top). Layout clamps it to the content — the effective value is
LayoutNode::scroll_y.
scrollbar: boolContainers: reserve a strip on the right edge and draw a vertical
scrollbar there whenever the content overflows (see
ScrollState for driving it).
font: StringFont id for text — empty (default) = Minecraft’s default font
(minecraft:default); also minecraft:uniform, minecraft:alt,
minecraft:illageralt or a resource-pack font such as mymod:fancy.
See crate::text for how non-default fonts are measured.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.