diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-26 14:45:50 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-26 15:10:18 +0300 |
| commit | 4719cc6d5942c70f43ae167d66d2383708ae3536 (patch) | |
| tree | 9904aa3e1453f3ace2767669653e968e302c4b52 /src | |
| parent | 98b92d4db7b5b6df8048be796fbfed2e197be561 (diff) | |
| download | niri-4719cc6d5942c70f43ae167d66d2383708ae3536.tar.gz niri-4719cc6d5942c70f43ae167d66d2383708ae3536.tar.bz2 niri-4719cc6d5942c70f43ae167d66d2383708ae3536.zip | |
cursor: Extract get_render_cursor_named()
Diffstat (limited to 'src')
| -rw-r--r-- | src/cursor.rs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/cursor.rs b/src/cursor.rs index 891854c0..a856de94 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -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, |
