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