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