create widgets_ontop
This commit is contained in:
@@ -100,6 +100,17 @@ pub fn move_cursor_to_end(ctx: &egui::Context, te_id: egui::Id) {
|
||||
TextEdit::store_state(ctx, te_id, state);
|
||||
}
|
||||
|
||||
pub fn widgets_ontop<R>(
|
||||
ui: &egui::Ui, id: String, re: &egui::Response, y_offset: f32,
|
||||
add_contents: impl FnOnce(&mut egui::Ui) -> R,
|
||||
) -> R {
|
||||
let area = egui::Area::new(id)
|
||||
.fixed_pos(re.rect.min.offset_y(y_offset))
|
||||
.order(egui::Order::Foreground);
|
||||
|
||||
area.show(ui.ctx(), |ui| add_contents(ui)).inner
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod autocomplete_tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user