pygui: refactoring of nodeutils and its usage, fixed issue with drawing custom nodes and copying services

This commit is contained in:
Blake Harnden 2021-02-18 10:47:20 -08:00
parent 422a1a500e
commit 47ac4c850d
12 changed files with 194 additions and 191 deletions

View file

@ -8,12 +8,18 @@ from PIL.ImageTk import PhotoImage
from core.api.grpc.wrappers import NodeType
from core.gui.appconfig import LOCAL_ICONS_PATH
ICON_SIZE: int = 48
class Images:
images: Dict[str, str] = {}
@classmethod
def create(cls, file_path: str, width: int, height: int = None) -> PhotoImage:
def create(
cls, file_path: str, width: int = None, height: int = None
) -> PhotoImage:
if width is None:
width = ICON_SIZE
if height is None:
height = width
image = Image.open(file_path)