From 8e864bdfbcf9ec226b3299c021b8b675b11dfe44 Mon Sep 17 00:00:00 2001 From: Konkitoman Date: Tue, 22 Aug 2023 11:08:56 +0300 Subject: [PATCH] typo: fix typos --- crates/eframe/src/native/epi_integration.rs | 1 + crates/eframe/src/native/run.rs | 4 +++- crates/egui-winit/src/lib.rs | 8 ++++---- crates/egui/src/containers/window.rs | 4 ++-- crates/egui/src/viewport.rs | 14 ++++++++++---- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index f2c0d1007..ea0f57c9e 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -316,6 +316,7 @@ pub struct EpiIntegration { pub beginning: Instant, pub egui_ctx: egui::Context, pending_full_output: egui::FullOutput, + /// When set, it is time to close the native window. close: bool, diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index b3a56bea5..e42b3793c 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -90,6 +90,7 @@ trait WinitApp { ) -> Option>>; fn get_window_winit_id(&self, id: ViewportId) -> Option; + fn get_window_id(&self, id: &winit::window::WindowId) -> Option; fn save_and_destroy(&mut self); @@ -471,6 +472,7 @@ mod glow_integration { render: Option>>, pub egui_winit: Option, } + /// This struct will contain both persistent and temporary glutin state. /// /// Platform Quirks: @@ -1246,7 +1248,7 @@ mod glow_integration { let glutin_ctx = self.running.read().as_ref().unwrap().glutin_ctx.clone(); let painter = self.running.read().as_ref().unwrap().painter.clone(); - // This onlt will happend when a viewport is sync + // This will only happen if the viewport is sync // That means that the viewport cannot be rendered by itself and needs his parent to be rendered { let win = glutin_ctx.read().windows.get(&viewport_id).unwrap().clone(); diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index c09329d16..6016e22a3 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -927,7 +927,7 @@ pub fn process_viewport_commands( // if this is not checked on x11 the input will be permanently taken until the app is killed! if let Some(focus) = focused { if focus == viewport_id { - // TODO possibile return the error to `egui::Context` + // TODO possible return the error to `egui::Context` let _ = win.drag_window(); } } @@ -968,14 +968,14 @@ pub fn process_viewport_commands( ViewportCommand::Resizable(v) => win.set_resizable(v), ViewportCommand::EnableButtons { close, - mimimize, + minimized, maximize, } => win.set_enabled_buttons( if close { WindowButtons::CLOSE } else { WindowButtons::empty() - } | if mimimize { + } | if minimized { WindowButtons::MINIMIZE } else { WindowButtons::empty() @@ -1002,7 +1002,7 @@ pub fn process_viewport_commands( .expect("Invalid ICON data!") })); } - ViewportCommand::IMEPossition(x, y) => win.set_ime_position(LogicalPosition::new(x, y)), + ViewportCommand::IMEPosition(x, y) => win.set_ime_position(LogicalPosition::new(x, y)), ViewportCommand::IMEAllowed(v) => win.set_ime_allowed(v), ViewportCommand::IMEPurpose(o) => win.set_ime_purpose(match o { 1 => winit::window::ImePurpose::Password, diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 8f6089e14..abacadbf9 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -85,7 +85,7 @@ impl<'open> Window<'open> { } /// This will only be used on window creation! - /// If embedded is false the window will be a native window, if is possibile + /// If embedded is false the window will be a native window, if is possible /// Look at `Context::is_desktop` to see if is possible to create a native window! pub fn default_embedded(mut self, embedded: bool) -> Self { self.default_embedded = embedded; @@ -1714,7 +1714,7 @@ impl TitleBar { } // Don't cover the close- and collapse buttons: - // After 32 is used for a temporary embedd button! + // After 32 is used for a temporary embedded button! let double_click_rect = self.rect.shrink2(vec2( 32.0 + ui.style().visuals.text_cursor.width + ui.style().spacing.icon_width, 0.0, diff --git a/crates/egui/src/viewport.rs b/crates/egui/src/viewport.rs index d8b9d9c2a..7c0fad904 100644 --- a/crates/egui/src/viewport.rs +++ b/crates/egui/src/viewport.rs @@ -23,7 +23,7 @@ impl ViewportId { pub type ViewportRender = dyn Fn(&Context) + Sync + Send; /// The filds in this struct should not be change directly, but is not problem tho! -/// Every thing is wraped in Option<> indicates that thing should not be changed! +/// Every thing is wrapped in Option<> indicates that thing should not be changed! #[derive(Hash, PartialEq, Eq, Clone)] pub struct ViewportBuilder { pub id: Id, @@ -114,6 +114,7 @@ impl ViewportBuilder { hittest: None, } } + pub fn with_title(mut self, title: impl Into) -> Self { self.title = title.into(); self @@ -149,7 +150,7 @@ impl ViewportBuilder { self } - /// The icon needs to be wraped in Arc because will be copyed every frame + /// The icon needs to be wrapped in Arc because will be copied every frame pub fn with_window_icon(mut self, icon: Option)>>) -> Self { self.icon = Some(icon); self @@ -246,27 +247,32 @@ pub enum ViewportCommand { MinInnerSize(Option<(u32, u32)>), MaxInnerSize(Option<(u32, u32)>), ResizeIncrements(Option<(u32, u32)>), + /// Top, Bottom, Right, Left Resize(bool, bool, bool, bool), Resizable(bool), EnableButtons { close: bool, - mimimize: bool, + minimized: bool, maximize: bool, }, Minimized(bool), Maximized(bool), Fullscreen(bool), Decorations(bool), + /// 0 = Normal, 1 = AlwaysOnBottom, 2 = AlwaysOnTop WindowLevel(u8), WindowIcon(Option<(Vec, u32, u32)>), - IMEPossition(u32, u32), + IMEPosition(u32, u32), IMEAllowed(bool), + /// 0 = Normal, 1 = Password, 2 = Terminal IMEPurpose(u8), + /// 0 = Informational, 1 = Critical RequestUserAttention(Option), + /// 0 = Light, 1 = Dark SetTheme(Option),