chore: Use cspell to fix some typos

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley
2024-03-02 09:38:54 -08:00
parent 388c40b1e0
commit 47e7d8b7fa
9 changed files with 72 additions and 21 deletions

13
.cspell.json Normal file
View File

@@ -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"]
}

38
project-words.txt Normal file
View File

@@ -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

View File

@@ -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).

View File

@@ -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"),
}
}
}

View File

@@ -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<ACCEL> = Vec::new();
/// # let accelerators: Vec<ACCEL> = Vec::new();
/// let translated = unsafe {
/// TranslateAcceleratorW(
/// (*msg).hwnd,
/// CreateAcceleratorTableW(accels.as_ptr() as _, 1),
/// CreateAcceleratorTableW(accelerators.as_ptr() as _, 1),
/// msg,
/// ) == 1
/// };

View File

@@ -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,

View File

@@ -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),

View File

@@ -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)]

View File

@@ -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