mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
refactor(icons): moved widget icons to class attribute ICON_NAME
This commit is contained in:
@ -7,6 +7,10 @@ from bec_widgets.utils.colors import set_theme
|
||||
class BECWidget(BECConnector):
|
||||
"""Mixin class for all BEC widgets, to handle cleanup"""
|
||||
|
||||
# The icon name is the name of the icon in the icon theme, typically a name taken
|
||||
# from fonts.google.com/icons. Override this in subclasses to set the icon name.
|
||||
ICON_NAME = "widgets"
|
||||
|
||||
def __init__(self, client=None, config: ConnectionConfig = None, gui_id: str = None):
|
||||
if not isinstance(self, QWidget):
|
||||
raise RuntimeError(f"{repr(self)} is not a subclass of QWidget")
|
||||
|
@ -2,8 +2,8 @@
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
||||
from qtpy.QtGui import QIcon
|
||||
|
||||
from bec_widgets.utils.bec_designer import designer_material_icon
|
||||
{widget_import}
|
||||
|
||||
DOM_XML = """
|
||||
@ -30,7 +30,7 @@ class {plugin_name_pascal}Plugin(QDesignerCustomWidgetInterface): # pragma: no
|
||||
return ""
|
||||
|
||||
def icon(self):
|
||||
return QIcon()
|
||||
return designer_material_icon({plugin_name_pascal}.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "{plugin_name_snake}"
|
||||
|
@ -13,6 +13,8 @@ class BECQueue(BECWidget, QWidget):
|
||||
Widget to display the BEC queue.
|
||||
"""
|
||||
|
||||
ICON_NAME = "edit_note"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent: QWidget | None = None,
|
||||
|
@ -34,7 +34,7 @@ class BECQueuePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Services"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("edit_note")
|
||||
return designer_material_icon(BECQueue.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "bec_queue"
|
||||
|
@ -43,6 +43,8 @@ class BECServiceStatusMixin(QObject):
|
||||
|
||||
services_update = Signal(dict, dict)
|
||||
|
||||
ICON_NAME = "dns"
|
||||
|
||||
def __init__(self, parent, client: BECClient):
|
||||
super().__init__(parent)
|
||||
self.client = client
|
||||
|
@ -34,7 +34,7 @@ class BECStatusBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Services"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("dns")
|
||||
return designer_material_icon(BECStatusBox.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "bec_status_box"
|
||||
|
@ -11,6 +11,8 @@ class ColorButton(pg.ColorButton):
|
||||
Patches event loop of the ColorDialog, if opened in another QDialog.
|
||||
"""
|
||||
|
||||
ICON_NAME = "colors"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
@ -31,7 +31,7 @@ class ColorButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Buttons"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("colors")
|
||||
return designer_material_icon(ColorButton.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "color_button"
|
||||
|
@ -46,6 +46,7 @@ class ColormapSelector(QWidget):
|
||||
"""
|
||||
|
||||
colormap_changed_signal = Signal(str)
|
||||
ICON_NAME = "palette"
|
||||
|
||||
def __init__(self, parent=None, default_colormaps=None):
|
||||
super().__init__(parent=parent)
|
||||
|
@ -34,7 +34,7 @@ class ColormapSelectorPlugin(QDesignerCustomWidgetInterface): # pragma: no cove
|
||||
return "BEC Buttons"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("palette")
|
||||
return designer_material_icon(ColormapSelector.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "colormap_selector"
|
||||
|
@ -9,6 +9,8 @@ from bec_widgets.utils.colors import set_theme
|
||||
class DarkModeButton(BECWidget, QWidget):
|
||||
USER_ACCESS = ["toggle_dark_mode"]
|
||||
|
||||
ICON_NAME = "dark_mode"
|
||||
|
||||
def __init__(
|
||||
self, parent: QWidget | None = None, client=None, gui_id: str | None = None
|
||||
) -> None:
|
||||
|
@ -30,7 +30,7 @@ class DarkModeButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Buttons"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("dark_mode")
|
||||
return designer_material_icon(DarkModeButton.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "dark_mode_button"
|
||||
|
@ -15,6 +15,8 @@ from bec_widgets.widgets.device_browser.device_item import DeviceItem
|
||||
class DeviceBrowser(BECWidget, QWidget):
|
||||
device_update: Signal = Signal()
|
||||
|
||||
ICON_NAME = "lists"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent: Optional[QWidget] = None,
|
||||
|
@ -30,7 +30,7 @@ class DeviceBrowserPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Services"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("lists")
|
||||
return designer_material_icon(DeviceBrowser.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "device_browser"
|
||||
|
@ -34,7 +34,7 @@ class DeviceComboBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "Device Control"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("list_alt")
|
||||
return designer_material_icon(DeviceComboBox.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "device_combobox"
|
||||
|
@ -22,6 +22,8 @@ class DeviceComboBox(DeviceInputBase, QComboBox):
|
||||
arg_name: Argument name, can be used for the other widgets which has to call some other function in bec using correct argument names.
|
||||
"""
|
||||
|
||||
ICON_NAME = "list_alt"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent=None,
|
||||
|
@ -24,6 +24,8 @@ class DeviceLineEdit(DeviceInputBase, QLineEdit):
|
||||
arg_name: Argument name, can be used for the other widgets which has to call some other function in bec using correct argument names.
|
||||
"""
|
||||
|
||||
ICON_NAME = "edit_note"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
parent=None,
|
||||
|
@ -34,7 +34,7 @@ class DeviceLineEditPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "Device Control"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("edit_note")
|
||||
return designer_material_icon(DeviceLineEdit.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "device_line_edit"
|
||||
|
@ -100,6 +100,7 @@ class CustomDockLabel(DockLabel):
|
||||
|
||||
|
||||
class BECDock(BECWidget, Dock):
|
||||
ICON_NAME = "widgets"
|
||||
USER_ACCESS = [
|
||||
"_config_dict",
|
||||
"_rpc_id",
|
||||
|
@ -18,7 +18,16 @@ from bec_widgets.qt_utils.toolbar import (
|
||||
)
|
||||
from bec_widgets.utils import ConnectionConfig, WidgetContainerUtils
|
||||
from bec_widgets.utils.bec_widget import BECWidget
|
||||
from bec_widgets.widgets.bec_queue.bec_queue import BECQueue
|
||||
from bec_widgets.widgets.bec_status_box.bec_status_box import BECStatusBox
|
||||
from bec_widgets.widgets.dock.dock import BECDock, DockConfig
|
||||
from bec_widgets.widgets.image.image_widget import BECImageWidget
|
||||
from bec_widgets.widgets.motor_map.motor_map_widget import BECMotorMapWidget
|
||||
from bec_widgets.widgets.positioner_box.positioner_box import PositionerBox
|
||||
from bec_widgets.widgets.ring_progress_bar.ring_progress_bar import RingProgressBar
|
||||
from bec_widgets.widgets.scan_control.scan_control import ScanControl
|
||||
from bec_widgets.widgets.vscode.vscode import VSCodeEditor
|
||||
from bec_widgets.widgets.waveform.waveform_widget import BECWaveformWidget
|
||||
|
||||
|
||||
class DockAreaConfig(ConnectionConfig):
|
||||
@ -71,13 +80,17 @@ class BECDockArea(BECWidget, QWidget):
|
||||
label="Add Plot ",
|
||||
actions={
|
||||
"waveform": MaterialIconAction(
|
||||
icon_name="show_chart", tooltip="Add Waveform", filled=True
|
||||
icon_name=BECWaveformWidget.ICON_NAME,
|
||||
tooltip="Add Waveform",
|
||||
filled=True,
|
||||
),
|
||||
"image": MaterialIconAction(
|
||||
icon_name="image", tooltip="Add Image", filled=True
|
||||
icon_name=BECImageWidget.ICON_NAME, tooltip="Add Image", filled=True
|
||||
),
|
||||
"motor_map": MaterialIconAction(
|
||||
icon_name="my_location", tooltip="Add Motor Map", filled=True
|
||||
icon_name=BECMotorMapWidget.ICON_NAME,
|
||||
tooltip="Add Motor Map",
|
||||
filled=True,
|
||||
),
|
||||
},
|
||||
),
|
||||
@ -86,10 +99,10 @@ class BECDockArea(BECWidget, QWidget):
|
||||
label="Add Device Control ",
|
||||
actions={
|
||||
"scan_control": MaterialIconAction(
|
||||
icon_name="stacked_line_chart", tooltip="Add Scan Control", filled=True
|
||||
icon_name=ScanControl.ICON_NAME, tooltip="Add Scan Control", filled=True
|
||||
),
|
||||
"positioner_box": MaterialIconAction(
|
||||
icon_name="switch_right", tooltip="Add Device Box", filled=True
|
||||
icon_name=PositionerBox.ICON_NAME, tooltip="Add Device Box", filled=True
|
||||
),
|
||||
},
|
||||
),
|
||||
@ -98,16 +111,18 @@ class BECDockArea(BECWidget, QWidget):
|
||||
label="Add Utils ",
|
||||
actions={
|
||||
"queue": MaterialIconAction(
|
||||
icon_name="edit_note", tooltip="Add Scan Queue", filled=True
|
||||
icon_name=BECQueue.ICON_NAME, tooltip="Add Scan Queue", filled=True
|
||||
),
|
||||
"vs_code": MaterialIconAction(
|
||||
icon_name="show_chart", tooltip="Add VS Code", filled=True
|
||||
icon_name=VSCodeEditor.ICON_NAME, tooltip="Add VS Code", filled=True
|
||||
),
|
||||
"status": MaterialIconAction(
|
||||
icon_name="dns", tooltip="Add BEC Status Box", filled=True
|
||||
icon_name=BECStatusBox.ICON_NAME,
|
||||
tooltip="Add BEC Status Box",
|
||||
filled=True,
|
||||
),
|
||||
"progress_bar": MaterialIconAction(
|
||||
icon_name="track_changes",
|
||||
icon_name=RingProgressBar.ICON_NAME,
|
||||
tooltip="Add Circular ProgressBar",
|
||||
filled=True,
|
||||
),
|
||||
|
@ -34,7 +34,7 @@ class BECDockAreaPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Plots"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("widgets")
|
||||
return designer_material_icon(BECDockArea.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "dock_area"
|
||||
|
@ -34,7 +34,7 @@ class BECImageWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Plots"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("image")
|
||||
return designer_material_icon(BECImageWidget.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "bec_image_widget"
|
||||
|
@ -23,6 +23,7 @@ from bec_widgets.widgets.figure.plots.image.image_item import BECImageItem
|
||||
|
||||
|
||||
class BECImageWidget(BECWidget, QWidget):
|
||||
ICON_NAME = "image"
|
||||
USER_ACCESS = [
|
||||
"image",
|
||||
"set",
|
||||
|
@ -32,7 +32,7 @@ class BECMotorMapWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cov
|
||||
return "BEC Plots"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("my_location")
|
||||
return designer_material_icon(BECMotorMapWidget.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "bec_motor_map_widget"
|
||||
|
@ -14,6 +14,7 @@ from bec_widgets.widgets.motor_map.motor_map_dialog.motor_map_settings import Mo
|
||||
|
||||
|
||||
class BECMotorMapWidget(BECWidget, QWidget):
|
||||
ICON_NAME = "my_location"
|
||||
USER_ACCESS = [
|
||||
"change_motors",
|
||||
"set_max_points",
|
||||
|
@ -5,6 +5,8 @@ from qtpy.QtWidgets import QWidget
|
||||
|
||||
class PositionIndicator(QWidget):
|
||||
|
||||
ICON_NAME = "horizontal_distribute"
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.position = 0.5
|
||||
|
@ -34,7 +34,7 @@ class PositionIndicatorPlugin(QDesignerCustomWidgetInterface): # pragma: no cov
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("horizontal_distribute")
|
||||
return designer_material_icon(PositionIndicator.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "position_indicator"
|
||||
|
@ -28,6 +28,7 @@ class PositionerBox(BECWidget, QWidget):
|
||||
ui_file = "positioner_box.ui"
|
||||
dimensions = (234, 224)
|
||||
|
||||
ICON_NAME = "switch_right"
|
||||
USER_ACCESS = ["set_positioner"]
|
||||
device_changed = Signal(str, str)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class PositionerBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "Device Control"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("switch_right")
|
||||
return designer_material_icon(PositionerBox.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "positioner_box"
|
||||
|
@ -9,6 +9,8 @@ class PositionerControlLine(PositionerBox):
|
||||
ui_file = "positioner_control_line.ui"
|
||||
dimensions = (60, 600) # height, width
|
||||
|
||||
ICON_NAME = "switch_left"
|
||||
|
||||
def __init__(self, parent=None, device: Positioner = None, *args, **kwargs):
|
||||
"""Initialize the DeviceControlLine.
|
||||
|
||||
|
@ -33,7 +33,7 @@ class PositionerControlLinePlugin(QDesignerCustomWidgetInterface): # pragma: no
|
||||
return "Device Control"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("switch_left")
|
||||
return designer_material_icon(PositionerControlLine.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "positioner_control_line"
|
||||
|
@ -68,6 +68,7 @@ class RingProgressBarConfig(ConnectionConfig):
|
||||
|
||||
|
||||
class RingProgressBar(BECWidget, QWidget):
|
||||
ICON_NAME = "track_changes"
|
||||
USER_ACCESS = [
|
||||
"_get_all_rpc",
|
||||
"_rpc_id",
|
||||
|
@ -33,7 +33,7 @@ class RingProgressBarPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("track_changes")
|
||||
return designer_material_icon(RingProgressBar.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "ring_progress_bar"
|
||||
|
@ -20,6 +20,8 @@ from bec_widgets.widgets.stop_button.stop_button import StopButton
|
||||
|
||||
class ScanControl(BECWidget, QWidget):
|
||||
|
||||
ICON_NAME = "tune"
|
||||
|
||||
scan_started = Signal()
|
||||
scan_selected = Signal(str)
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
import os
|
||||
|
||||
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
||||
|
||||
import bec_widgets
|
||||
from bec_widgets.utils.bec_designer import designer_material_icon
|
||||
from bec_widgets.widgets.scan_control.scan_control import ScanControl
|
||||
|
||||
@ -14,7 +12,6 @@ DOM_XML = """
|
||||
</widget>
|
||||
</ui>
|
||||
"""
|
||||
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
|
||||
|
||||
|
||||
class ScanControlPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
@ -33,7 +30,7 @@ class ScanControlPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "Device Control"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("stacked_line_chart")
|
||||
return designer_material_icon(ScanControl.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "scan_control"
|
||||
|
@ -13,6 +13,8 @@ def ease_in_out_sine(t):
|
||||
|
||||
|
||||
class SpinnerWidget(QWidget):
|
||||
ICON_NAME = "progress_activity"
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
|
@ -34,7 +34,7 @@ class SpinnerWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("progress_activity")
|
||||
return designer_material_icon(SpinnerWidget.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "spinner_widget"
|
||||
|
@ -7,6 +7,8 @@ from bec_widgets.utils.bec_widget import BECWidget
|
||||
class StopButton(BECWidget, QPushButton):
|
||||
"""A button that stops the current scan."""
|
||||
|
||||
ICON_NAME = "dangerous"
|
||||
|
||||
def __init__(self, parent=None, client=None, config=None, gui_id=None):
|
||||
super().__init__(client=client, config=config, gui_id=gui_id)
|
||||
QPushButton.__init__(self, parent=parent)
|
||||
|
@ -34,7 +34,7 @@ class StopButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("dangerous")
|
||||
return designer_material_icon(StopButton.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "stop_button"
|
||||
|
@ -31,6 +31,7 @@ class TextBoxConfig(ConnectionConfig):
|
||||
class TextBox(BECWidget, QTextEdit):
|
||||
|
||||
USER_ACCESS = ["set_color", "set_text", "set_font_size"]
|
||||
ICON_NAME = "chat"
|
||||
|
||||
def __init__(self, parent=None, text: str = "", client=None, config=None, gui_id=None):
|
||||
if config is None:
|
||||
|
@ -33,7 +33,7 @@ class TextBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("chat")
|
||||
return designer_material_icon(TextBox.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "text_box"
|
||||
|
@ -11,6 +11,7 @@ class ToggleSwitch(QWidget):
|
||||
"""
|
||||
|
||||
enabled = Signal(bool)
|
||||
ICON_NAME = "toggle_on"
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
|
@ -34,7 +34,7 @@ class ToggleSwitchPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("toggle_on")
|
||||
return designer_material_icon(ToggleSwitch.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "toggle_switch"
|
||||
|
@ -34,7 +34,7 @@ class VSCodeEditorPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Developer"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("developer_mode_tv")
|
||||
return designer_material_icon(VSCodeEditor.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "vs_code_editor"
|
||||
|
@ -18,6 +18,7 @@ class VSCodeEditor(WebsiteWidget):
|
||||
port = 7000
|
||||
|
||||
USER_ACCESS = []
|
||||
ICON_NAME = "developer_mode_tv"
|
||||
|
||||
def __init__(self, parent=None, config=None, client=None, gui_id=None):
|
||||
|
||||
|
@ -34,7 +34,7 @@ class BECWaveformWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cov
|
||||
return "BEC Plots"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("show_chart")
|
||||
return designer_material_icon(BECWaveformWidget.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "bec_waveform_widget"
|
||||
|
@ -28,6 +28,7 @@ except ImportError:
|
||||
|
||||
|
||||
class BECWaveformWidget(BECWidget, QWidget):
|
||||
ICON_NAME = "show_chart"
|
||||
USER_ACCESS = [
|
||||
"curves",
|
||||
"plot",
|
||||
@ -105,7 +106,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
||||
),
|
||||
"separator_2": SeparatorAction(),
|
||||
"curves": MaterialIconAction(
|
||||
icon_name="stacked_line_chart", tooltip="Open Curves Configuration"
|
||||
icon_name="timeline", tooltip="Open Curves Configuration"
|
||||
),
|
||||
"fit_params": MaterialIconAction(
|
||||
icon_name="monitoring", tooltip="Open Fitting Parameters"
|
||||
|
@ -19,6 +19,7 @@ class WebsiteWidget(BECWidget, QWebEngineView):
|
||||
A simple widget to display a website
|
||||
"""
|
||||
|
||||
ICON_NAME = "travel_explore"
|
||||
USER_ACCESS = ["set_url", "get_url", "reload", "back", "forward"]
|
||||
|
||||
def __init__(self, parent=None, url: str = None, config=None, client=None, gui_id=None):
|
||||
|
@ -33,7 +33,7 @@ class WebsiteWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
||||
return "BEC Utils"
|
||||
|
||||
def icon(self):
|
||||
return designer_material_icon("travel_explore")
|
||||
return designer_material_icon(WebsiteWidget.ICON_NAME)
|
||||
|
||||
def includeFile(self):
|
||||
return "website_widget"
|
||||
|
Reference in New Issue
Block a user