Skip to content

Commit

Permalink
Anchor toasts bottom left and move load indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
woelper committed Dec 9, 2023
1 parent 9f8c688 commit da217eb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/appstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl Default for OculanteState {
checker_texture: Default::default(),
redraw: Default::default(),
first_start: true,
toasts: Toasts::default(),
toasts: Toasts::default().with_anchor(egui_notify::Anchor::BottomLeft),
}
}
}
30 changes: 15 additions & 15 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,21 +1007,21 @@ fn drawe(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins, state: &mut O
edit_ui(app, ctx, state, gfx);
}

if !state.is_loaded {
egui::TopBottomPanel::bottom("loader").show_animated(
ctx,
state.current_path.is_some(),
|ui| {
if let Some(p) = &state.current_path {
ui.horizontal(|ui| {
ui.add(egui::Spinner::default());
ui.label(format!("Loading {}", p.display()));
});
}
app.window().request_frame();
},
);
}
// if !state.is_loaded {
// egui::TopBottomPanel::bottom("loader").show_animated(
// ctx,
// state.current_path.is_some(),
// |ui| {
// if let Some(p) = &state.current_path {
// ui.horizontal(|ui| {
// ui.add(egui::Spinner::default());
// ui.label(format!("Loading {}", p.display()));
// });
// }
// app.window().request_frame();
// },
// );
// }

state.pointer_over_ui = ctx.is_pointer_over_area();
// info!("using pointer {}", ctx.is_using_pointer());
Expand Down
13 changes: 13 additions & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,19 @@ pub fn main_menu(ui: &mut Ui, state: &mut OculanteState, app: &mut App, gfx: &mu
}
}

if !state.is_loaded {

if let Some(p) = &state.current_path {
ui.horizontal(|ui| {
ui.add(egui::Spinner::default());
ui.label(format!("Loading {}", p.display()));
});
}
app.window().request_frame();


}

ui.add_space(ui.available_width() - 32.);

ui.scope(|ui| {
Expand Down

0 comments on commit da217eb

Please sign in to comment.