1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 15:13:12 -04:00

Now viewports will be identified by there id a normal egui::Id

Before viewports was identified by there title
This commit is contained in:
Konkitoman
2023-08-22 10:34:43 +03:00
parent 2949874287
commit ab59bf8c88
5 changed files with 23 additions and 19 deletions

View File

@@ -63,7 +63,7 @@ impl eframe::App for App {
if self.show_async_viewport {
let state = self.async_viewport_state.clone();
ctx.create_viewport(
ViewportBuilder::default().with_title("Async Viewport"),
ViewportBuilder::new("Async Viewport").with_title("Async Viewport"),
move |ctx| {
let mut state = state.write().unwrap();
let content = |ui: &mut egui::Ui| {
@@ -96,7 +96,7 @@ impl eframe::App for App {
// Showing Sync Viewport
if self.show_sync_viewport {
ctx.create_viewport_sync(
ViewportBuilder::default().with_title("Sync Viewport"),
ViewportBuilder::new("Sync Viewport").with_title("Sync Viewport"),
|ctx| {
let content = |ui: &mut egui::Ui| {
ui.label(format!("Frame: {}", ctx.frame_nr()));