diff --git a/src/utils/icon.py b/src/utils/icon.py new file mode 100644 index 0000000..4297a5e --- /dev/null +++ b/src/utils/icon.py @@ -0,0 +1,18 @@ +from PyQt6 import QtCore, QtGui + + +class Icon: + def __init__(self, icon_name, extension="svg"): + self.icon = QtGui.QIcon() + self.icon.addPixmap( + QtGui.QPixmap(f"icons/{icon_name}.{extension}"), + QtGui.QIcon.Mode.Normal, + QtGui.QIcon.State.Off, + ) + + def set_icon(self, widget): + widget.setIcon(self.icon) + + @staticmethod + def icondata(self): + return self.icon