19 lines
457 B
Python
19 lines
457 B
Python
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
|