mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
cursor: Extract get_render_cursor_named()
This commit is contained in:
+15
-12
@@ -75,21 +75,24 @@ impl CursorManager {
|
||||
|
||||
RenderCursor::Surface { hotspot, surface }
|
||||
}
|
||||
CursorImageStatus::Named(icon) => self
|
||||
.get_cursor_with_name(icon, scale)
|
||||
.map(|cursor| RenderCursor::Named {
|
||||
icon,
|
||||
scale,
|
||||
cursor,
|
||||
})
|
||||
.unwrap_or_else(|| RenderCursor::Named {
|
||||
icon: Default::default(),
|
||||
scale,
|
||||
cursor: self.get_default_cursor(scale),
|
||||
}),
|
||||
CursorImageStatus::Named(icon) => self.get_render_cursor_named(icon, scale),
|
||||
}
|
||||
}
|
||||
|
||||
fn get_render_cursor_named(&self, icon: CursorIcon, scale: i32) -> RenderCursor {
|
||||
self.get_cursor_with_name(icon, scale)
|
||||
.map(|cursor| RenderCursor::Named {
|
||||
icon,
|
||||
scale,
|
||||
cursor,
|
||||
})
|
||||
.unwrap_or_else(|| RenderCursor::Named {
|
||||
icon: Default::default(),
|
||||
scale,
|
||||
cursor: self.get_default_cursor(scale),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_current_cursor_animated(&self, scale: i32) -> bool {
|
||||
match &self.current_cursor {
|
||||
CursorImageStatus::Hidden => false,
|
||||
|
||||
Reference in New Issue
Block a user