diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000..2af8d753d --- /dev/null +++ b/.cspell.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json", + "version": "0.2", + "dictionaryDefinitions": [ + { + "name": "project-words", + "path": "./project-words.txt", + "addWords": true + } + ], + "dictionaries": ["project-words"], + "ignorePaths": ["/target", "/project-words.txt"] + } \ No newline at end of file diff --git a/project-words.txt b/project-words.txt new file mode 100644 index 000000000..e6d37bba6 --- /dev/null +++ b/project-words.txt @@ -0,0 +1,38 @@ +adwaita +apartmentthreaded +bitflags +borderless +clipchildren +coinit +crossfont +dbus +dlopen +donotround +dwmwcp +dwmsbt +fullscreen +glutin +hittest +hmenu +hmonitor +hwnd +kwin +mainwindow +noredirectionbitmap +notitle +preedit +randr +repr +roundsmall +rustdoc +systembackdrop +tabbedwindow +transientwindow +winit +xext +xlib +xrandr +xrender +xresources +xpresent +xscrnsaver \ No newline at end of file diff --git a/src/platform/wayland.rs b/src/platform/wayland.rs index 24301ee08..b0ef2de43 100644 --- a/src/platform/wayland.rs +++ b/src/platform/wayland.rs @@ -7,7 +7,7 @@ //! //! ## Client-side decorations //! -//! Winit provides client-side decorations by default, but the behaviour can +//! Winit provides client-side decorations by default, but the behavior can //! be controlled with the following feature flags: //! //! * `wayland-csd-adwaita` (default). diff --git a/src/platform/web.rs b/src/platform/web.rs index fd4982702..7af1c47c9 100644 --- a/src/platform/web.rs +++ b/src/platform/web.rs @@ -82,7 +82,7 @@ pub trait WindowExtWebSys { /// would prevent that. /// /// Some events are impossible to prevent. E.g. Firefox allows to access the native browser - /// context menu with Shift+Rightclick. + /// context menu with Shift+Right-click. fn set_prevent_default(&self, prevent_default: bool); } @@ -274,7 +274,7 @@ pub trait CustomCursorExtWebSys { /// but browser support for image formats is inconsistent. Using [PNG] is recommended. /// /// [PNG]: https://en.wikipedia.org/wiki/PNG - fn from_url(url: String, hotspot_x: u16, hotspot_y: u16) -> CustomCursorSource; + fn from_url(url: String, hot_spot_x: u16, hot_spot_y: u16) -> CustomCursorSource; /// Crates a new animated cursor from multiple [`CustomCursor`]s. /// Supplied `cursors` can't be empty or other animations. @@ -289,12 +289,12 @@ impl CustomCursorExtWebSys for CustomCursor { self.inner.animation } - fn from_url(url: String, hotspot_x: u16, hotspot_y: u16) -> CustomCursorSource { + fn from_url(url: String, hot_spot_x: u16, hot_spot_y: u16) -> CustomCursorSource { CustomCursorSource { inner: PlatformCustomCursorSource::Url { url, - hotspot_x, - hotspot_y, + hot_spot_x, + hot_spot_y, }, } } @@ -330,7 +330,7 @@ impl fmt::Display for BadAnimation { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Empty => write!(f, "No cursors supplied"), - Self::Animation => write!(f, "A supplied cursor is an animtion"), + Self::Animation => write!(f, "A supplied cursor is an animation"), } } } diff --git a/src/platform/windows.rs b/src/platform/windows.rs index 39e4ee016..48ae05f09 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -157,11 +157,11 @@ pub trait EventLoopBuilderExtWindows { /// #[cfg(target_os = "windows")] /// builder.with_msg_hook(|msg|{ /// let msg = msg as *const MSG; - /// # let accels: Vec = Vec::new(); + /// # let accelerators: Vec = Vec::new(); /// let translated = unsafe { /// TranslateAcceleratorW( /// (*msg).hwnd, - /// CreateAcceleratorTableW(accels.as_ptr() as _, 1), + /// CreateAcceleratorTableW(accelerators.as_ptr() as _, 1), /// msg, /// ) == 1 /// }; diff --git a/src/platform/x11.rs b/src/platform/x11.rs index afeb12c24..05935749e 100644 --- a/src/platform/x11.rs +++ b/src/platform/x11.rs @@ -16,14 +16,14 @@ use crate::dpi::Size; #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum WindowType { /// A desktop feature. This can include a single window containing desktop icons with the same dimensions as the - /// screen, allowing the desktop environment to have full control of the desktop, without the need for proxying + /// screen, allowing the desktop environment to have full control of the desktop, without the need for proxy-ing /// root window clicks. Desktop, /// A dock or panel feature. Typically a Window Manager would keep such windows on top of all other windows. Dock, /// Toolbar windows. "Torn off" from the main application. Toolbar, - /// Pinnable menu windows. "Torn off" from the main application. + /// Pin-able menu windows. "Torn off" from the main application. Menu, /// A small persistent utility window, such as a palette or toolbox. Utility, diff --git a/src/platform_impl/web/cursor.rs b/src/platform_impl/web/cursor.rs index 2ba08d964..8fc6d2929 100644 --- a/src/platform_impl/web/cursor.rs +++ b/src/platform_impl/web/cursor.rs @@ -31,8 +31,8 @@ pub(crate) enum CustomCursorSource { Image(CursorImage), Url { url: String, - hotspot_x: u16, - hotspot_y: u16, + hot_spot_x: u16, + hot_spot_y: u16, }, Animation { duration: Duration, @@ -88,8 +88,8 @@ impl CustomCursor { ), CustomCursorSource::Url { url, - hotspot_x, - hotspot_y, + hot_spot_x: hotspot_x, + hot_spot_y: hotspot_y, } => Self::build_spawn( event_loop, from_url(UrlType::Plain(url), hotspot_x, hotspot_y), diff --git a/src/utils.rs b/src/utils.rs index 5bb52a4af..8e8d25ca7 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,5 +1,5 @@ // A poly-fill for `lazy_cell` -// Replace with std::sync::LazyLock when https://github.com/rust-lang/rust/issues/109736 is stablized. +// Replace with std::sync::LazyLock when https://github.com/rust-lang/rust/issues/109736 is stabilized. // This isn't used on every platform, which can come up as dead code warnings. #![allow(dead_code)] diff --git a/src/window.rs b/src/window.rs index 2aa49dde7..fb1b23cf7 100644 --- a/src/window.rs +++ b/src/window.rs @@ -70,8 +70,8 @@ pub struct Window { } impl fmt::Debug for Window { - fn fmt(&self, fmtr: &mut fmt::Formatter<'_>) -> fmt::Result { - fmtr.pad("Window { .. }") + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.pad("Window { .. }") } } @@ -1026,7 +1026,7 @@ impl Window { /// Sets whether the window is resizable or not. /// - /// Note that making the window unresizable doesn't exempt you from handling [`WindowEvent::Resized`], as that + /// Note that making the window un-resizable doesn't exempt you from handling [`WindowEvent::Resized`], as that /// event can still be triggered by DPI scaling, entering fullscreen mode, etc. Also, the /// window could still be resized by calling [`Window::request_inner_size`]. /// @@ -1235,7 +1235,7 @@ impl Window { /// Sets the window icon. /// /// On Windows and X11, this is typically the small icon in the top-left - /// corner of the titlebar. + /// corner of the title bar. /// /// ## Platform-specific /// @@ -1375,7 +1375,7 @@ impl Window { /// is already focused. How requesting for user attention manifests is platform dependent, /// see [`UserAttentionType`] for details. /// - /// Providing `None` will unset the request for user attention. Unsetting the request for + /// Providing `None` will unset the request for user attention. Un-setting the request for /// user attention might not be done automatically by the WM when the window receives input. /// /// ## Platform-specific