Improved `icon.rs` example's text.

Added TODO and bug example (half-fixed it, background_color is still rounded).
This commit is contained in:
Well 2023-08-18 01:22:29 -03:00
parent bd792210ce
commit 474ab51e2e
3 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,19 @@
```rust
use zero_ui_material_icons as icons;
App::default().extend(icons::MaterialFonts).run_window(async {
Window! {
//background_color = colors::YELLOW;
child_align = Align::CENTER;
child = Icon!{
ico = icons::outlined::N3G_MOBILEDATA;
//size = 500;
background_color = colors::RED;
border = 10, colors::GREEN.with_alpha(20.pct());
};
}
})
```
# TextInput
* Implement selection.
@ -14,6 +30,11 @@
- Ellipses, fade-out.
- Very visible in icon example.
# Tooltip
* Tooltips stop showing upon interaction (click/tab/enter/etc) in HTML.
- Ours doesn't.
# View-Process
* Update to winit-29 when released.

View File

@ -168,8 +168,10 @@ fn icon_btn(ico: icons::MaterialIcon, font_mod: &'static str) -> impl UiNode {
},
Text! {
txt = formatx!("{ico}");
txt_wrap = false;
txt_align = Align::CENTER;
font_size = 10;
height = 2.em();
line_height = 1.em();
},
]
};

View File

@ -41,7 +41,7 @@ fn on_build(wgt: &mut WidgetBuilding) {
wgt.set_child(text::nodes::render_text());
wgt.push_intrinsic(NestGroup::FILL, "layout_text", text::nodes::layout_text);
wgt.push_intrinsic(NestGroup::CHILD_LAYOUT + 100, "layout_text", text::nodes::layout_text);
wgt.push_intrinsic(NestGroup::EVENT, "resolve_text", move |child| {
let node = text::nodes::resolve_text(child, icon.map(|i| i.glyph.clone().into()));
let node = text::font_family(node, icon.map(|i| i.font.clone().into()));