From 287f7041f6d46e41f7d52b2bf3a8d6437a2895d1 Mon Sep 17 00:00:00 2001 From: Konkitoman Date: Sat, 30 Sep 2023 10:22:17 +0300 Subject: [PATCH] Fix typos and expose Context::is_desktop --- crates/eframe/src/native/run.rs | 2 +- crates/egui/src/context.rs | 5 +++++ crates/egui/src/viewport.rs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index dd021fbab..5f50f3d31 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -689,7 +689,7 @@ mod glow_integration { viewports: windows, builders, viewports_maps: window_maps, - // This is initializate in init_run_state + // This is initialize in init_run_state max_texture_side: 0, }) } diff --git a/crates/egui/src/context.rs b/crates/egui/src/context.rs index d3804c51c..6c4150481 100644 --- a/crates/egui/src/context.rs +++ b/crates/egui/src/context.rs @@ -2571,6 +2571,11 @@ impl Context { }); } + /// This will tell you if is possible to open a native window + pub fn is_desktop(&self) -> bool { + self.read(|ctx| ctx.is_desktop) + } + /// If this is true no other native windows will be created pub fn force_embedding(&self) -> bool { self.read(|ctx| ctx.force_embedding) diff --git a/crates/egui/src/viewport.rs b/crates/egui/src/viewport.rs index 202d8e0e1..7a81f90d8 100644 --- a/crates/egui/src/viewport.rs +++ b/crates/egui/src/viewport.rs @@ -331,7 +331,7 @@ impl ViewportBuilder { /// Build window with the given name. /// /// The `general` name sets an application ID, which should match the `.desktop` - /// file destributed with your program. The `instance` is a `no-op`. + /// file distributed with your program. The `instance` is a `no-op`. /// /// For details about application ID conventions, see the /// [Desktop Entry Spec](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id)