1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Remove viewport_id and parent_viewport_id from Window::show arguments because can be accessed from Context::get_viewport_id and Context::get_parent_viewport_id

This commit is contained in:
Konkitoman
2023-08-03 19:53:17 +03:00
parent 7f791f4bf9
commit 1448c5047f
30 changed files with 81 additions and 81 deletions

View File

@@ -53,7 +53,7 @@ impl ThreadState {
let title = self.data.read().unwrap().title.clone();
egui::Window::new(title)
.default_pos(pos)
.show(ctx, move |ui, _, _| {
.show(ctx, move |ui| {
let data = &mut *clone.data.write().unwrap();
ui.horizontal(|ui| {
ui.label("Your name: ");
@@ -147,10 +147,11 @@ impl eframe::App for MyApp {
return;
}
let data = self.data.clone();
egui::Window::new("Main thread").show(ctx, move |ui, _, parent_id| {
egui::Window::new("Main thread").show(ctx, move |ui| {
if ui.button("Spawn another thread").clicked() {
data.write().unwrap().spawn_thread();
ui.ctx().request_repaint_viewport(parent_id);
ui.ctx()
.request_repaint_viewport(ui.ctx().get_parent_viewport_id());
}
});