UN-GCPDS / qt-material

Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6
https://qt-material.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
2.27k stars 241 forks source link

how add custom icon ? #66

Open ebdm13 opened 2 years ago

ebdm13 commented 2 years ago

I would like add custom icon like this: cutsom_icon

but, as you can see, they don't have the same color as the theme

my stylesheet look like this:

.is_toggled::indicator:checked{{
    image: url(src/icons/toggle_on.svg)
}}

.is_toggled::indicator:unchecked{{
    image: url(src/icons/toggle_off.svg)
}}

but there are no fill and stroke property for manage svg colors 😢

and I added the menu icons like this:

self.add_profile = QAction(QIcon("src/icons/add_profile.svg"), "Add Profile", self)
self.add_profile.triggered.connect(self.open_profile)
self.change_mail_bot = QAction(QIcon("src/icons/mail.svg"), "Change Mail Bot", self)

someone have an idea for a way to do this ? maybe try to do with the replace_color funcion in ResourseGenerator class ? I also thought it can be do with Q_PRPOPERTY