cursor: refactor CustomCursor to be dyn
cursor: refactor `CustomCursor` to be `dyn` Same as for `MonitorHandle`, the source was changed to support all kinds of sources.
This commit is contained in:
parent
a0464ae83b
commit
ae28eea406
26 changed files with 329 additions and 333 deletions
|
|
@ -15,7 +15,7 @@ use windows_sys::Win32::UI::WindowsAndMessaging::{
|
|||
};
|
||||
|
||||
use super::util;
|
||||
use crate::cursor::CursorImage;
|
||||
use crate::cursor::{CursorImage, CustomCursorProvider};
|
||||
use crate::dpi::PhysicalSize;
|
||||
use crate::error::RequestError;
|
||||
use crate::icon::*;
|
||||
|
|
@ -196,6 +196,12 @@ impl Default for SelectedCursor {
|
|||
#[derive(Clone, Debug, Hash, Eq, PartialEq)]
|
||||
pub struct WinCursor(pub(super) Arc<RaiiCursor>);
|
||||
|
||||
impl CustomCursorProvider for WinCursor {
|
||||
fn is_animated(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl WinCursor {
|
||||
pub(crate) fn new(image: &CursorImage) -> Result<Self, RequestError> {
|
||||
let mut bgra = image.rgba.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue