create widgets_ontop

This commit is contained in:
Simon Gardling
2022-04-20 11:20:43 -04:00
parent 0336a34e40
commit 9afa4d86bc
3 changed files with 59 additions and 45 deletions

View File

@@ -490,7 +490,7 @@ impl MathApp {
}
impl epi::App for MathApp {
/// Called each time the UI needs repainting, which may be many times per second.
/// Called each time the UI needs repainting.
fn update(&mut self, ctx: &Context, _frame: &mut epi::Frame) {
// start timer
let start = instant::Instant::now();
@@ -501,8 +501,9 @@ impl epi::App for MathApp {
false => Visuals::light(),
});
// if keyboard input isn't being grabed, check for key combos
// If keyboard input isn't being grabbed, check for key combos
if !ctx.wants_keyboard_input() {
// If `H` key is pressed, toggle Side Panel
self.opened
.side_panel
.bitxor_assign(ctx.input_mut().consume_key(egui::Modifiers::NONE, Key::H));