Improved Cursors

- Cursor position is now float instead of integer, making movement way smoother
- Added a fallback cursor to use in Wayland sessions
This commit is contained in:
Martin Prokoph
2024-07-17 23:23:05 +02:00
parent bdb3c36518
commit 45149af859
16 changed files with 69 additions and 38 deletions

View File

@@ -81,4 +81,12 @@ public enum VirtualMouseSkin implements Nameable {
public static @NotNull Optional<VirtualMouseSkin> byId(@NotNull String id) {
return Arrays.stream(values()).filter(mode -> mode.getName().equalsIgnoreCase(id)).findFirst();
}
public String getSpritePath() {
return switch (this) {
case DEFAULT_LIGHT -> "cursor/light/default";
case DEFAULT_DARK -> "cursor/dark/default";
case SECOND_LIGHT -> "cursor/light/secondary";
case SECOND_DARK -> "cursor/dark/secondary";
};
}
}