Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased

- Implement `Hash` for `ParseError`.
- Add `CursorIcon::DndAsk` and `CursorIcon::AllResize` from the wayland-protocols version 1.42

## 1.1.0

Expand Down
20 changes: 19 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,24 @@ pub enum CursorIcon {
/// Indicates that something can be zoomed in. Often rendered as a
/// magnifying glass with a "-" in the center of the glass.
ZoomOut,

/// Indicates that the user will select the action that will be carried out.
///
/// This is a non-standard extension of the w3c standard used in freedesktop
/// cursor icon themes.
DndAsk,

/// Indicates that something can be moved or resized in any direction.
///
/// This is a non-standard extension of the w3c standard used in freedesktop
/// cursor icon themes.
AllResize,
}

impl CursorIcon {
/// The name of the cursor icon as defined in w3c standard.
/// The name of the cursor icon as defined in the w3c standard.
/// Non-standard cursors such as "DndAsk" and "AllResize" are translated as
/// "dnd-ask" and "all-resize" respectively.
///
/// This name most of the time could be passed as is to cursor loading
/// libraries on X11/Wayland and could be used as-is on web.
Expand Down Expand Up @@ -319,6 +333,8 @@ impl CursorIcon {
CursorIcon::AllScroll => "all-scroll",
CursorIcon::ZoomIn => "zoom-in",
CursorIcon::ZoomOut => "zoom-out",
CursorIcon::DndAsk => "dnd-ask",
CursorIcon::AllResize => "all-resize",
Comment thread
m4rch3n1ng marked this conversation as resolved.
}
}

Expand Down Expand Up @@ -363,6 +379,8 @@ impl CursorIcon {
CursorIcon::AllScroll => &["size_all"],
CursorIcon::ZoomIn => &[],
CursorIcon::ZoomOut => &[],
CursorIcon::DndAsk => &["copy"],
CursorIcon::AllResize => &["move"],
}
}
}
Expand Down