mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-03-12 03:37:56 +01:00
refactor: moved to dynamically loaded material design icons
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
import os
|
||||
|
||||
from bec_qthemes import material_icon
|
||||
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
||||
from qtpy.QtGui import QIcon
|
||||
from qtpy.QtGui import QGuiApplication, QIcon
|
||||
|
||||
import bec_widgets
|
||||
from bec_widgets.examples.plugin_example_pyside.tictactoe import TicTacToe
|
||||
@@ -46,8 +47,9 @@ class TicTacToePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "Games"
|
||||
|
||||
def icon(self):
|
||||
icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "games.png")
|
||||
return QIcon(icon_path)
|
||||
palette = QGuiApplication.palette()
|
||||
pixmap = material_icon("sports_esports", color=palette.text().color(), filled=True)
|
||||
return QIcon(pixmap)
|
||||
|
||||
def includeFile(self):
|
||||
return "tictactoe"
|
||||
|
||||
Reference in New Issue
Block a user