mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-12-22 12:28:19 -06:00
add wrap flag
This commit is contained in:
parent
fff37d7345
commit
59271bd76d
|
@ -1,10 +1,12 @@
|
|||
use hui::{
|
||||
color, element::{
|
||||
color, size,
|
||||
layout::UiDirection,
|
||||
element::{
|
||||
container::Container,
|
||||
fill_rect::FillRect,
|
||||
text::Text,
|
||||
UiElementExt
|
||||
}, layout::{Alignment, UiDirection}, size
|
||||
},
|
||||
};
|
||||
|
||||
#[path = "../boilerplate.rs"]
|
||||
|
@ -18,7 +20,7 @@ ui_main!(|ui, size, _| {
|
|||
.with_padding(5.)
|
||||
.with_gap(10.)
|
||||
.with_background(color::WHITE)
|
||||
//.with_wrap(true)
|
||||
.with_wrap(true)
|
||||
.with_children(|ui| {
|
||||
Text::default()
|
||||
.with_color(color::BLACK)
|
||||
|
|
|
@ -51,6 +51,10 @@ pub struct Container {
|
|||
#[setters(into)]
|
||||
pub corner_radius: Corners<f32>,
|
||||
|
||||
/// Should the elements wrap?\
|
||||
/// TODO: NOT IMPLEMENTED YET, implement this
|
||||
pub wrap: bool,
|
||||
|
||||
/// List of children elements
|
||||
#[setters(skip)]
|
||||
pub children: ElementList,
|
||||
|
@ -73,6 +77,7 @@ impl Default for Container {
|
|||
align: Alignment2d::default(),
|
||||
background: Default::default(),
|
||||
children: ElementList(Vec::new()),
|
||||
wrap: false,
|
||||
corner_radius: Corners::all(0.),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue