""" UI utility functions for Tagger GUI (PySide6). """ from pathlib import Path from PySide6.QtGui import QIcon, QPixmap def load_icon(path: str | Path, size: int = 16) -> QIcon: """ Load an icon from file and optionally resize. Args: path: Path to the image file size: Icon size in pixels (default 16) Returns: QIcon object """ pixmap = QPixmap(str(path)) if not pixmap.isNull(): pixmap = pixmap.scaled(size, size) return QIcon(pixmap)