Add a scrollbar to the node finder

This commit is contained in:
Setzer22 2022-11-13 16:05:46 +01:00
parent 2607f55746
commit 9f7826ae95

View File

@ -65,9 +65,16 @@ where
let mut query_submit = resp.lost_focus() && ui.input().key_down(Key::Enter); let mut query_submit = resp.lost_focus() && ui.input().key_down(Key::Enter);
let max_height = ui.input().screen_rect.height() * 0.5;
let scroll_area_width = resp.rect.width() - 30.0;
Frame::default() Frame::default()
.inner_margin(vec2(10.0, 10.0)) .inner_margin(vec2(10.0, 10.0))
.show(ui, |ui| { .show(ui, |ui| {
ScrollArea::vertical()
.max_height(max_height)
.show(ui, |ui| {
ui.set_width(scroll_area_width);
for kind in all_kinds.all_kinds() { for kind in all_kinds.all_kinds() {
let kind_name = kind.node_finder_label(user_state).to_string(); let kind_name = kind.node_finder_label(user_state).to_string();
if kind_name if kind_name
@ -85,6 +92,7 @@ where
}); });
}); });
}); });
});
submitted_archetype submitted_archetype
} }