Path: blob/main/crates/bevy_feathers/src/containers/group.rs
30636 views
use bevy_scene::{bsn, Scene};1use bevy_text::FontWeight;2use bevy_ui::{px, AlignItems, Display, FlexDirection, JustifyContent, Node, UiRect};34use crate::{5constants::{fonts, size},6font_styles::InheritableFont,7rounded_corners::RoundedCorners,8theme::{InheritableThemeTextColor, ThemeBackgroundColor, ThemeBorderColor},9tokens,10};1112/// Group13pub fn group() -> impl Scene {14bsn! {15Node {16display: Display::Flex,17flex_direction: FlexDirection::Column,18align_items: AlignItems::Stretch,19}20}21}2223/// Group header24pub fn group_header() -> impl Scene {25bsn! {26Node {27display: Display::Flex,28flex_direction: FlexDirection::Row,29align_items: AlignItems::Center,30justify_content: JustifyContent::SpaceBetween,31border: UiRect {32left: px(1),33top: px(1),34right: px(1),35},36padding: UiRect::horizontal(px(10)),37min_height: size::HEADER_HEIGHT,38column_gap: px(4),39border_radius: {RoundedCorners::Top.to_border_radius(4.0)}40}41ThemeBackgroundColor(tokens::GROUP_HEADER_BG)42ThemeBorderColor(tokens::GROUP_HEADER_BORDER)43InheritableThemeTextColor(tokens::GROUP_HEADER_TEXT)44InheritableFont {45font: fonts::REGULAR,46font_size: size::MEDIUM_FONT,47weight: FontWeight::NORMAL,48}49}50}5152/// Group body53pub fn group_body() -> impl Scene {54bsn! {55Node {56display: Display::Flex,57flex_direction: FlexDirection::Column,58border: UiRect {59left: px(1),60right: px(1),61bottom: px(1),62},63row_gap: px(4),64padding: px(6),65border_radius: {RoundedCorners::Bottom.to_border_radius(4.0)}66}67ThemeBackgroundColor(tokens::GROUP_BODY_BG)68ThemeBorderColor(tokens::GROUP_BODY_BORDER)69InheritableFont {70font: fonts::REGULAR,71font_size: size::MEDIUM_FONT,72weight: FontWeight::NORMAL,73}74}75}767778