From 24333b806af478ca06416aaf9b14ac55005f9f95 Mon Sep 17 00:00:00 2001 From: Osspial Date: Fri, 13 Apr 2018 13:53:01 -0400 Subject: [PATCH] Update windows set_cursor to use more variants of MouseCursor (#407) * Update windows set_cursor to use more variants of MouseCursor * Add changelog entry --- CHANGELOG.md | 1 + src/platform/windows/window.rs | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4585d6ed..bcccc033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Implement `WindowEvent::HiDPIFactorChanged` for macOS - On X11, input methods now work completely out of the box, no longer requiring application developers to manually call `setlocale`. Additionally, when input methods are started, stopped, or restarted on the server end, it's correctly handled. - Implemented `Refresh` event on Windows. +- Map more `MouseCursor` variants to cursor icons on Windows. # Version 0.12.0 (2018-04-06) diff --git a/src/platform/windows/window.rs b/src/platform/windows/window.rs index e362ac2e..4ed36749 100644 --- a/src/platform/windows/window.rs +++ b/src/platform/windows/window.rs @@ -255,13 +255,18 @@ impl Window { MouseCursor::Crosshair => winuser::IDC_CROSS, MouseCursor::Text | MouseCursor::VerticalText => winuser::IDC_IBEAM, MouseCursor::NotAllowed | MouseCursor::NoDrop => winuser::IDC_NO, - MouseCursor::EResize => winuser::IDC_SIZEWE, - MouseCursor::NResize => winuser::IDC_SIZENS, - MouseCursor::WResize => winuser::IDC_SIZEWE, - MouseCursor::SResize => winuser::IDC_SIZENS, + MouseCursor::Grab | MouseCursor::Grabbing | + MouseCursor::Move | MouseCursor::AllScroll => winuser::IDC_SIZEALL, + MouseCursor::EResize | MouseCursor::WResize | MouseCursor::EwResize | MouseCursor::ColResize => winuser::IDC_SIZEWE, + MouseCursor::NResize | MouseCursor::SResize | MouseCursor::NsResize | MouseCursor::RowResize => winuser::IDC_SIZENS, - MouseCursor::Wait | MouseCursor::Progress => winuser::IDC_WAIT, + MouseCursor::NeResize | MouseCursor::SwResize | + MouseCursor::NeswResize => winuser::IDC_SIZENESW, + MouseCursor::NwResize | MouseCursor::SeResize | + MouseCursor::NwseResize => winuser::IDC_SIZENWSE, + MouseCursor::Wait => winuser::IDC_WAIT, + MouseCursor::Progress => winuser::IDC_APPSTARTING, MouseCursor::Help => winuser::IDC_HELP, _ => winuser::IDC_ARROW, // use arrow for the missing cases. };