Add ui::ContentGroup
(#20666)
TL;DR our version of [HIG's Box](https://developer.apple.com/design/human-interface-guidelines/boxes) We can't use the name `Box` (because rust) or `ContentBox` (because taffy/styles/css). --- This PR introduces the `ContentGroup` component, a flexible container inspired by HIG's `Box` component. It's designed to hold and organize various UI elements with options to toggle borders and background fills. **Example usage**: ```rust ContentGroup::new() .flex_1() .items_center() .justify_center() .h_48() .child(Label::new("Flexible ContentBox")) ``` Here are some configurations: - Default: Includes both border and fill. - Borderless: No border for a clean look. - Unfilled: No background fill for a transparent appearance. **Preview**:  --- _This PR was written by a large language model with input from the author._ Release Notes: - N/A
This commit is contained in:
parent
f7b4431659
commit
04ba75e2e5
6 changed files with 173 additions and 11 deletions
|
@ -5,8 +5,8 @@ use theme::all_theme_colors;
|
|||
use ui::{
|
||||
element_cell, prelude::*, string_cell, utils::calculate_contrast_ratio, AudioStatus,
|
||||
Availability, Avatar, AvatarAudioStatusIndicator, AvatarAvailabilityIndicator, ButtonLike,
|
||||
Checkbox, CheckboxWithLabel, DecoratedIcon, ElevationIndex, Facepile, IconDecoration,
|
||||
Indicator, Table, TintColor, Tooltip,
|
||||
Checkbox, CheckboxWithLabel, ContentGroup, DecoratedIcon, ElevationIndex, Facepile,
|
||||
IconDecoration, Indicator, Table, TintColor, Tooltip,
|
||||
};
|
||||
|
||||
use crate::{Item, Workspace};
|
||||
|
@ -510,6 +510,7 @@ impl ThemePreview {
|
|||
.overflow_scroll()
|
||||
.size_full()
|
||||
.gap_2()
|
||||
.child(ContentGroup::render_component_previews(cx))
|
||||
.child(IconDecoration::render_component_previews(cx))
|
||||
.child(DecoratedIcon::render_component_previews(cx))
|
||||
.child(Checkbox::render_component_previews(cx))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue