Hi, I'm trying to pull off rendering a classic drop-down. Using the on-hover event was bad, as the hover target is SUPER sensitive, so I've abandoned the idea to have a "Filter" type button, with a simple toggle state.
Please forgive the nested mass of closure code below:
// Filter
ui.element()
.width(grow!())
.height(fit!())
// .background_color(0x262220)
.corner_radius(12.0)
.layout(|l| l.align(Right, CenterY))
.children(|ui| {
ui.element()
.width(fit!())
.height(fit!())
.background_color(0x262220)
// .corner_radius(12.0)
.layout(|l| l.padding(16))
.children(|ui| {
ui.element()
.width(fit!()).height(fit!())
.background_color(0x2E2A28)
.on_press(|id, pointer| {})
.children(|ui| {
ui.text("Hover me for info", |t| t.font_size(14).color(0xE8E0DC));
ui.element()
.floating(|f| f
.attach_parent()
.anchor((Right, Top), (Right, Top))
// compensate for padding in parent
.offset((16.0, 30.0))
)
.children(|ui| {
ui.element()
.width(grow!()).height(grow!())
.background_color(0x262220)
// .overflow(|o| {
// o.scroll_y()
// .scrollbar(|builder| {
// builder.width(12.0)
// })
// })
.layout(|l| {
// Block
l.direction(TopToBottom)
.padding(20)
.gap(30)
.align(Right, Bottom)
})
.children(|ui| {
ui.text("Extra information here - super long text", |t| t.font_size(12).color(0x9E9590));
// child items grow for as many items in the drop-down
});
});
});
});
});
One issue I'm facing is this is all inside a root element that is ALREADY an overflow handling parent. It also does not seem floating elements can support overflow out of the box anyways? Have I missed something?
Cheers,
Mike.
Hi, I'm trying to pull off rendering a classic drop-down. Using the on-hover event was bad, as the hover target is SUPER sensitive, so I've abandoned the idea to have a "Filter" type button, with a simple toggle state.
Please forgive the nested mass of closure code below:
One issue I'm facing is this is all inside a root element that is ALREADY an overflow handling parent. It also does not seem floating elements can support overflow out of the box anyways? Have I missed something?
Cheers,
Mike.