mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-22 07:08:42 -06:00
a
This commit is contained in:
parent
9aa61f392e
commit
f8b2a4e15f
|
@ -42,11 +42,13 @@ fn main() {
|
||||||
|
|
||||||
hui.add({
|
hui.add({
|
||||||
Container::default()
|
Container::default()
|
||||||
|
.with_size((UiSize::Fraction(1.), UiSize::Fraction(1.)))
|
||||||
.with_padding(Sides::all(5.))
|
.with_padding(Sides::all(5.))
|
||||||
.with_children(|ui: &mut ElementList| {
|
.with_children(|ui: &mut ElementList| {
|
||||||
Text::default()
|
Text::default()
|
||||||
.with_text("Hello, world")
|
.with_text("Hello, world")
|
||||||
.with_text_size(12)
|
.with_text_size(120)
|
||||||
|
.with_color(vec4(0., 0., 0., 1.))
|
||||||
.add_to(ui);
|
.add_to(ui);
|
||||||
})
|
})
|
||||||
}, resolution);
|
}, resolution);
|
||||||
|
|
|
@ -84,11 +84,11 @@ impl From<Vec<Box<dyn UiElement>>> for ElementList {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait UiElementListExt {
|
pub trait UiElementListExt {
|
||||||
fn add_to(self, list: &mut ElementList);
|
fn add_to(self, ui: &mut ElementList);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: UiElement + 'static> UiElementListExt for T {
|
impl<T: UiElement + 'static> UiElementListExt for T {
|
||||||
fn add_to(self, list: &mut ElementList) {
|
fn add_to(self, ui: &mut ElementList) {
|
||||||
list.add(self)
|
ui.add(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue