Merge pull request #192 from bjwbell/mouse-cursors
Add mouse cursor support
This commit is contained in:
commit
05a03fb6a1
8 changed files with 179 additions and 4 deletions
62
src/lib.rs
62
src/lib.rs
|
|
@ -90,6 +90,62 @@ pub enum Api {
|
|||
OpenGlEs,
|
||||
}
|
||||
|
||||
#[derive(Show, Copy)]
|
||||
pub enum MouseCursor {
|
||||
/// The platform-dependent default cursor.
|
||||
Default,
|
||||
/// A simple crosshair.
|
||||
Crosshair,
|
||||
/// A hand (often used to indicate links in web browsers).
|
||||
Hand,
|
||||
/// Self explanatory.
|
||||
Arrow,
|
||||
/// Indicates something is to be moved.
|
||||
Move,
|
||||
/// Indicates text that may be selected or edited.
|
||||
Text,
|
||||
/// Program busy indicator.
|
||||
Wait,
|
||||
/// Help indicator (often rendered as a "?")
|
||||
Help,
|
||||
/// Progress indicator. Shows that processing is being done. But in contrast
|
||||
/// with "Wait" the user may still interact with the program. Often rendered
|
||||
/// as a spinning beach ball, or an arrow with a watch or hourglass.
|
||||
Progress,
|
||||
|
||||
/// Cursor showing that something cannot be done.
|
||||
NotAllowed,
|
||||
ContextMenu,
|
||||
NoneCursor,
|
||||
Cell,
|
||||
VerticalText,
|
||||
Alias,
|
||||
Copy,
|
||||
NoDrop,
|
||||
Grab,
|
||||
Grabbing,
|
||||
AllScroll,
|
||||
ZoomIn,
|
||||
ZoomOut,
|
||||
|
||||
/// Indicate that some edge is to be moved. For example, the 'SeResize' cursor
|
||||
/// is used when the movement starts from the south-east corner of the box.
|
||||
EResize,
|
||||
NResize,
|
||||
NeResize,
|
||||
NwResize,
|
||||
SResize,
|
||||
SeResize,
|
||||
SwResize,
|
||||
WResize,
|
||||
EwResize,
|
||||
NsResize,
|
||||
NeswResize,
|
||||
NwseResize,
|
||||
ColResize,
|
||||
RowResize,
|
||||
}
|
||||
|
||||
/// Object that allows you to build windows.
|
||||
#[cfg(feature = "window")]
|
||||
pub struct WindowBuilder<'a> {
|
||||
|
|
@ -559,6 +615,12 @@ impl Window {
|
|||
pub fn set_window_resize_callback(&mut self, callback: Option<fn(usize, usize)>) {
|
||||
self.window.set_window_resize_callback(callback);
|
||||
}
|
||||
|
||||
/// Modifies the mouse cursor of the window.
|
||||
/// Has no effect on Android.
|
||||
pub fn set_cursor(&mut self, cursor: MouseCursor) {
|
||||
self.window.set_cursor(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue