Create custom cursor with directly with event loop
Replace the `CustomCursorBuilder` with the `CustomCursorSource` and perform the loading of the cursor via the `EventLoop::create_custom_cursor` instead of passing it to the builder itself. This follows the `EventLoop::create_window` API.
This commit is contained in:
parent
3fb93b4f83
commit
7abd427216
26 changed files with 213 additions and 175 deletions
|
|
@ -24,6 +24,7 @@ use crate::{
|
|||
},
|
||||
platform::ios::Idiom,
|
||||
platform_impl::platform::app_state::{EventLoopHandler, HandlePendingUserEvents},
|
||||
window::{CustomCursor, CustomCursorSource},
|
||||
};
|
||||
|
||||
use super::{app_state, monitor, view, MonitorHandle};
|
||||
|
|
@ -38,6 +39,13 @@ pub struct ActiveEventLoop {
|
|||
}
|
||||
|
||||
impl ActiveEventLoop {
|
||||
pub fn create_custom_cursor(&self, source: CustomCursorSource) -> CustomCursor {
|
||||
let _ = source.inner;
|
||||
CustomCursor {
|
||||
inner: super::PlatformCustomCursor,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn available_monitors(&self) -> VecDeque<MonitorHandle> {
|
||||
monitor::uiscreens(self.mtm)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue