Download ui/cursor.py from sayed555/manga1: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/spaces/sayed555/manga1/resolve/main/ui/cursor.py
- Command line
-
hf download hf://spaces/sayed555/manga1/ui/cursor.py
-
curl -L -o cursor.py https://huggingface.co/spaces/sayed555/manga1/resolve/main/ui/cursor.py
1.62 kB
| from qtpy.QtCore import Qt | |
| from qtpy.QtGui import QPixmap, QCursor | |
| from functools import cached_property | |
| import os | |
| class RotateCursorList: | |
| def Cursor0(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor0.png')) | |
| def Cursor1(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor1.png')) | |
| def Cursor2(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor2.png')) | |
| def Cursor3(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor3.png')) | |
| def Cursor4(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor4.png')) | |
| def Cursor5(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor5.png')) | |
| def Cursor6(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor6.png')) | |
| def Cursor7(self): | |
| return QCursor(QPixmap(r'icons/rotate_cursor7.png')) | |
| def __getitem__(self, idx): | |
| return self.__getattribute__('Cursor' + str(idx)) | |
| resizeCursorList = [ | |
| Qt.CursorShape.SizeFDiagCursor, | |
| Qt.CursorShape.SizeVerCursor, | |
| Qt.CursorShape.SizeBDiagCursor, | |
| Qt.CursorShape.SizeHorCursor | |
| ] | |
| rotateCursorList = RotateCursorList() | |
| def get_magic_wand_cursor(): | |
| cursor_path = os.path.join(os.path.dirname(__file__), 'resources', 'magic_wand_cursor.png') | |
| if os.path.exists(cursor_path): | |
| pixmap = QPixmap(cursor_path) | |
| return QCursor(pixmap, hotX=0, hotY=0) | |
| else: | |
| return None | |