code release

This commit is contained in:
iperov 2021-07-23 17:34:49 +04:00
parent b941ba41a3
commit a902f11f74
354 changed files with 826570 additions and 1 deletions

View file

@ -0,0 +1,21 @@
from pathlib import Path
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from xlib import path as lib_path
from xlib.qt.gui.from_file import QXImage_from_file
from xlib.qt.gui.QXImageSequence import QXImageSequence
class QXImageSequenceDB:
cached = {}
def _get(dir_path : Path, fps, color=None):
key = (dir_path, fps, color)
result = QXImageSequenceDB.cached.get(key, None)
if result is None:
image_paths = lib_path.get_files_paths(dir_path)
result = QXImageSequenceDB.cached[key] = QXImageSequence(frames=[QXImage_from_file (image_path, color) for image_path in image_paths], fps=fps)
return result
def icon_loading(color=None) -> QXImageSequence: return QXImageSequenceDB._get(Path(__file__).parent / 'sequences' / 'icon_loading', fps=30, color=color)