bec-widgets 0.96.3__py3-none-any.whl → 0.98.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. CHANGELOG.md +36 -42
  2. PKG-INFO +1 -1
  3. bec_widgets/examples/plugin_example_pyside/tictactoeplugin.py +2 -5
  4. bec_widgets/qt_utils/toolbar.py +28 -23
  5. bec_widgets/utils/bec_designer.py +15 -0
  6. bec_widgets/utils/colors.py +30 -6
  7. bec_widgets/widgets/bec_queue/bec_queue_plugin.py +2 -5
  8. bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +2 -5
  9. bec_widgets/widgets/color_button/color_button_plugin.py +2 -5
  10. bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py +2 -5
  11. bec_widgets/widgets/device_browser/device_browser_plugin.py +2 -5
  12. bec_widgets/widgets/device_combobox/device_combo_box_plugin.py +2 -5
  13. bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +2 -5
  14. bec_widgets/widgets/dock/dock_area.py +46 -21
  15. bec_widgets/widgets/dock/dock_area_plugin.py +2 -5
  16. bec_widgets/widgets/figure/figure.py +0 -1
  17. bec_widgets/widgets/image/bec_image_widget_plugin.py +2 -5
  18. bec_widgets/widgets/image/image_widget.py +28 -28
  19. bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py +2 -5
  20. bec_widgets/widgets/motor_map/motor_map_widget.py +6 -4
  21. bec_widgets/widgets/position_indicator/position_indicator_plugin.py +2 -5
  22. bec_widgets/widgets/positioner_box/positioner_box.py +6 -9
  23. bec_widgets/widgets/positioner_box/positioner_box_plugin.py +2 -5
  24. bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +2 -5
  25. bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +2 -5
  26. bec_widgets/widgets/scan_control/scan_control.py +3 -1
  27. bec_widgets/widgets/scan_control/scan_control_plugin.py +2 -5
  28. bec_widgets/widgets/spinner/spinner_widget_plugin.py +2 -5
  29. bec_widgets/widgets/stop_button/stop_button_plugin.py +2 -5
  30. bec_widgets/widgets/text_box/text_box_plugin.py +2 -5
  31. bec_widgets/widgets/toggle/toggle_switch_plugin.py +2 -5
  32. bec_widgets/widgets/vscode/vs_code_editor_plugin.py +2 -5
  33. bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +2 -5
  34. bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +4 -6
  35. bec_widgets/widgets/waveform/waveform_widget.py +18 -19
  36. bec_widgets/widgets/website/website_widget_plugin.py +2 -5
  37. {bec_widgets-0.96.3.dist-info → bec_widgets-0.98.0.dist-info}/METADATA +1 -1
  38. {bec_widgets-0.96.3.dist-info → bec_widgets-0.98.0.dist-info}/RECORD +42 -42
  39. pyproject.toml +1 -1
  40. {bec_widgets-0.96.3.dist-info → bec_widgets-0.98.0.dist-info}/WHEEL +0 -0
  41. {bec_widgets-0.96.3.dist-info → bec_widgets-0.98.0.dist-info}/entry_points.txt +0 -0
  42. {bec_widgets-0.96.3.dist-info → bec_widgets-0.98.0.dist-info}/licenses/LICENSE +0 -0
@@ -10,7 +10,7 @@ from bec_widgets.qt_utils.error_popups import SafeSlot, WarningPopupUtility
10
10
  from bec_widgets.qt_utils.settings_dialog import SettingsDialog
11
11
  from bec_widgets.qt_utils.toolbar import (
12
12
  DeviceSelectionAction,
13
- IconAction,
13
+ MaterialIconAction,
14
14
  ModularToolBar,
15
15
  SeparatorAction,
16
16
  )
@@ -66,45 +66,45 @@ class BECImageWidget(BECWidget, QWidget):
66
66
  "monitor": DeviceSelectionAction(
67
67
  "Monitor:", DeviceComboBox(device_filter="Device")
68
68
  ),
69
- "connect": IconAction(icon_path="connection.svg", tooltip="Connect Device"),
69
+ "connect": MaterialIconAction(icon_name="link", tooltip="Connect Device"),
70
70
  "separator_0": SeparatorAction(),
71
- "save": IconAction(icon_path="save.svg", tooltip="Open Export Dialog"),
71
+ "save": MaterialIconAction(icon_name="save", tooltip="Open Export Dialog"),
72
72
  "separator_1": SeparatorAction(),
73
- "drag_mode": IconAction(
74
- icon_path="drag_pan_mode.svg", tooltip="Drag Mouse Mode", checkable=True
73
+ "drag_mode": MaterialIconAction(
74
+ icon_name="open_with", tooltip="Drag Mouse Mode", checkable=True
75
75
  ),
76
- "rectangle_mode": IconAction(
77
- icon_path="rectangle_mode.svg", tooltip="Rectangle Zoom Mode", checkable=True
76
+ "rectangle_mode": MaterialIconAction(
77
+ icon_name="frame_inspect", tooltip="Rectangle Zoom Mode", checkable=True
78
78
  ),
79
- "auto_range": IconAction(icon_path="auto_range.svg", tooltip="Autorange Plot"),
80
- "auto_range_image": IconAction(
81
- icon_path="image_autorange.svg",
82
- tooltip="Autorange Image Intensity",
83
- checkable=True,
79
+ "auto_range": MaterialIconAction(
80
+ icon_name="open_in_full", tooltip="Autorange Plot"
84
81
  ),
85
- "aspect_ratio": IconAction(
86
- icon_path="lock_aspect_ratio.svg",
87
- tooltip="Lock image aspect ratio",
88
- checkable=True,
82
+ "auto_range_image": MaterialIconAction(
83
+ icon_name="hdr_auto", tooltip="Autorange Image Intensity", checkable=True
84
+ ),
85
+ "aspect_ratio": MaterialIconAction(
86
+ icon_name="aspect_ratio", tooltip="Lock image aspect ratio", checkable=True
89
87
  ),
90
88
  "separator_2": SeparatorAction(),
91
- "FFT": IconAction(icon_path="fft.svg", tooltip="Toggle FFT", checkable=True),
92
- "log": IconAction(
93
- icon_path="log_scale.png", tooltip="Toggle log scale", checkable=True
89
+ "FFT": MaterialIconAction(icon_name="fft", tooltip="Toggle FFT", checkable=True),
90
+ "log": MaterialIconAction(
91
+ icon_name="log_scale", tooltip="Toggle log scale", checkable=True
92
+ ),
93
+ "transpose": MaterialIconAction(
94
+ icon_name="transform", tooltip="Transpose Image", checkable=True
94
95
  ),
95
- "transpose": IconAction(
96
- icon_path="transform.svg", tooltip="Transpose Image", checkable=True
96
+ "rotate_right": MaterialIconAction(
97
+ icon_name="rotate_right", tooltip="Rotate image clockwise by 90 deg"
97
98
  ),
98
- "rotate_right": IconAction(
99
- icon_path="rotate_right.svg", tooltip="Rotate image clockwise by 90 deg"
99
+ "rotate_left": MaterialIconAction(
100
+ icon_name="rotate_left", tooltip="Rotate image counterclockwise by 90 deg"
100
101
  ),
101
- "rotate_left": IconAction(
102
- icon_path="rotate_left.svg", tooltip="Rotate image counterclockwise by 90 deg"
102
+ "reset": MaterialIconAction(
103
+ icon_name="reset_settings", tooltip="Reset Image Settings"
103
104
  ),
104
- "reset": IconAction(icon_path="reset_settings.svg", tooltip="Reset Image Settings"),
105
105
  "separator_3": SeparatorAction(),
106
- "axis_settings": IconAction(
107
- icon_path="settings.svg", tooltip="Open Configuration Dialog"
106
+ "axis_settings": MaterialIconAction(
107
+ icon_name="settings", tooltip="Open Configuration Dialog"
108
108
  ),
109
109
  },
110
110
  target_widget=self,
@@ -1,10 +1,9 @@
1
1
  import os
2
2
 
3
- from bec_qthemes import material_icon
4
3
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
5
- from qtpy.QtGui import QGuiApplication, QIcon
6
4
 
7
5
  import bec_widgets
6
+ from bec_widgets.utils.bec_designer import designer_material_icon
8
7
  from bec_widgets.widgets.motor_map.motor_map_widget import BECMotorMapWidget
9
8
 
10
9
  DOM_XML = """
@@ -33,9 +32,7 @@ class BECMotorMapWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cov
33
32
  return "BEC Plots"
34
33
 
35
34
  def icon(self):
36
- palette = QGuiApplication.palette()
37
- pixmap = material_icon("my_location", color=palette.text().color(), filled=True)
38
- return QIcon(pixmap)
35
+ return designer_material_icon("my_location")
39
36
 
40
37
  def includeFile(self):
41
38
  return "bec_motor_map_widget"
@@ -5,7 +5,7 @@ import sys
5
5
  from qtpy.QtWidgets import QVBoxLayout, QWidget
6
6
 
7
7
  from bec_widgets.qt_utils.settings_dialog import SettingsDialog
8
- from bec_widgets.qt_utils.toolbar import DeviceSelectionAction, IconAction, ModularToolBar
8
+ from bec_widgets.qt_utils.toolbar import DeviceSelectionAction, MaterialIconAction, ModularToolBar
9
9
  from bec_widgets.utils.bec_widget import BECWidget
10
10
  from bec_widgets.widgets.device_combobox.device_combobox import DeviceComboBox
11
11
  from bec_widgets.widgets.figure import BECFigure
@@ -54,9 +54,11 @@ class BECMotorMapWidget(BECWidget, QWidget):
54
54
  "motor_y": DeviceSelectionAction(
55
55
  "Motor Y:", DeviceComboBox(device_filter="Positioner")
56
56
  ),
57
- "connect": IconAction(icon_path="connection.svg", tooltip="Connect Motors"),
58
- "history": IconAction(icon_path="history.svg", tooltip="Reset Trace History"),
59
- "config": IconAction(icon_path="settings.svg", tooltip="Open Configuration Dialog"),
57
+ "connect": MaterialIconAction(icon_name="link", tooltip="Connect Motors"),
58
+ "history": MaterialIconAction(icon_name="history", tooltip="Reset Trace History"),
59
+ "config": MaterialIconAction(
60
+ icon_name="settings", tooltip="Open Configuration Dialog"
61
+ ),
60
62
  },
61
63
  target_widget=self,
62
64
  )
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.position_indicator.position_indicator import PositionIndicator
11
10
 
12
11
  DOM_XML = """
@@ -35,9 +34,7 @@ class PositionIndicatorPlugin(QDesignerCustomWidgetInterface): # pragma: no cov
35
34
  return "BEC Utils"
36
35
 
37
36
  def icon(self):
38
- palette = QGuiApplication.palette()
39
- pixmap = material_icon("horizontal_distribute", color=palette.text().color(), filled=True)
40
- return QIcon(pixmap)
37
+ return designer_material_icon("horizontal_distribute")
41
38
 
42
39
  def includeFile(self):
43
40
  return "position_indicator"
@@ -7,13 +7,14 @@ from bec_lib.device import Positioner
7
7
  from bec_lib.endpoints import MessageEndpoints
8
8
  from bec_lib.logger import bec_logger
9
9
  from bec_lib.messages import ScanQueueMessage
10
- from qtpy.QtCore import Property, QSize, Signal, Slot
11
- from qtpy.QtGui import QDoubleValidator, QIcon
10
+ from bec_qthemes import material_icon
11
+ from qtpy.QtCore import Property, Signal, Slot
12
+ from qtpy.QtGui import QDoubleValidator
12
13
  from qtpy.QtWidgets import QDialog, QDoubleSpinBox, QPushButton, QVBoxLayout, QWidget
13
14
 
14
15
  from bec_widgets.utils import UILoader
15
16
  from bec_widgets.utils.bec_widget import BECWidget
16
- from bec_widgets.utils.colors import apply_theme
17
+ from bec_widgets.utils.colors import set_theme
17
18
  from bec_widgets.widgets.device_line_edit.device_line_edit import DeviceLineEdit
18
19
 
19
20
  logger = bec_logger.logger
@@ -78,11 +79,7 @@ class PositionerBox(BECWidget, QWidget):
78
79
  self.ui.setpoint.setValidator(self.setpoint_validator)
79
80
  self.ui.spinner_widget.start()
80
81
  self.ui.tool_button.clicked.connect(self._open_dialog_selection)
81
- icon = QIcon()
82
- icon.addFile(
83
- os.path.join(MODULE_PATH, "assets", "toolbar_icons", "device_line_edit.svg"),
84
- size=QSize(16, 16),
85
- )
82
+ icon = material_icon(icon_name="edit_note", size=(16, 16), convert_to_pixmap=False)
86
83
  self.ui.tool_button.setIcon(icon)
87
84
 
88
85
  def _open_dialog_selection(self):
@@ -303,7 +300,7 @@ if __name__ == "__main__": # pragma: no cover
303
300
  from qtpy.QtWidgets import QApplication
304
301
 
305
302
  app = QApplication(sys.argv)
306
- apply_theme("dark")
303
+ set_theme("dark")
307
304
  widget = PositionerBox(device="bpm4i")
308
305
 
309
306
  widget.show()
@@ -3,10 +3,9 @@
3
3
 
4
4
  import os
5
5
 
6
- from bec_qthemes import material_icon
7
6
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
8
- from qtpy.QtGui import QGuiApplication, QIcon
9
7
 
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.positioner_box.positioner_box import PositionerBox
11
10
 
12
11
  DOM_XML = """
@@ -34,9 +33,7 @@ class PositionerBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
33
  return "Device Control"
35
34
 
36
35
  def icon(self):
37
- palette = QGuiApplication.palette()
38
- pixmap = material_icon("switch_right", color=palette.text().color(), filled=True)
39
- return QIcon(pixmap)
36
+ return designer_material_icon("switch_right")
40
37
 
41
38
  def includeFile(self):
42
39
  return "positioner_box"
@@ -3,10 +3,9 @@
3
3
 
4
4
  import os
5
5
 
6
- from bec_qthemes import material_icon
7
6
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
8
- from qtpy.QtGui import QGuiApplication, QIcon
9
7
 
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.positioner_box.positioner_control_line import PositionerControlLine
11
10
 
12
11
  DOM_XML = """
@@ -34,9 +33,7 @@ class PositionerControlLinePlugin(QDesignerCustomWidgetInterface): # pragma: no
34
33
  return "Device Control"
35
34
 
36
35
  def icon(self):
37
- palette = QGuiApplication.palette()
38
- pixmap = material_icon("switch_left", color=palette.text().color(), filled=True)
39
- return QIcon(pixmap)
36
+ return designer_material_icon("switch_left")
40
37
 
41
38
  def includeFile(self):
42
39
  return "positioner_control_line"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.ring_progress_bar.ring_progress_bar import RingProgressBar
11
10
 
12
11
  DOM_XML = """
@@ -34,9 +33,7 @@ class RingProgressBarPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
33
  return "BEC Utils"
35
34
 
36
35
  def icon(self):
37
- palette = QGuiApplication.palette()
38
- pixmap = material_icon("track_changes", color=palette.text().color(), filled=True)
39
- return QIcon(pixmap)
36
+ return designer_material_icon("track_changes")
40
37
 
41
38
  def includeFile(self):
42
39
  return "ring_progress_bar"
@@ -260,10 +260,12 @@ class ScanControl(BECWidget, QWidget):
260
260
 
261
261
  # Application example
262
262
  if __name__ == "__main__": # pragma: no cover
263
+ from bec_widgets.utils.colors import set_theme
264
+
263
265
  app = QApplication([])
264
266
  scan_control = ScanControl()
265
267
 
266
- apply_theme("dark")
268
+ set_theme("auto")
267
269
  window = scan_control
268
270
  window.show()
269
271
  app.exec()
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.scan_control.scan_control import ScanControl
11
10
 
12
11
  DOM_XML = """
@@ -34,9 +33,7 @@ class ScanControlPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
33
  return "Device Control"
35
34
 
36
35
  def icon(self):
37
- palette = QGuiApplication.palette()
38
- pixmap = material_icon("stacked_line_chart", color=palette.text().color(), filled=True)
39
- return QIcon(pixmap)
36
+ return designer_material_icon("stacked_line_chart")
40
37
 
41
38
  def includeFile(self):
42
39
  return "scan_control"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.spinner.spinner import SpinnerWidget
11
10
 
12
11
  DOM_XML = """
@@ -35,9 +34,7 @@ class SpinnerWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
35
34
  return "BEC Utils"
36
35
 
37
36
  def icon(self):
38
- palette = QGuiApplication.palette()
39
- pixmap = material_icon("progress_activity", color=palette.text().color(), filled=True)
40
- return QIcon(pixmap)
37
+ return designer_material_icon("progress_activity")
41
38
 
42
39
  def includeFile(self):
43
40
  return "spinner_widget"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.stop_button.stop_button import StopButton
11
10
 
12
11
  DOM_XML = """
@@ -35,9 +34,7 @@ class StopButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
35
34
  return "BEC Utils"
36
35
 
37
36
  def icon(self):
38
- palette = QGuiApplication.palette()
39
- pixmap = material_icon("dangerous", color=palette.text().color(), filled=True)
40
- return QIcon(pixmap)
37
+ return designer_material_icon("dangerous")
41
38
 
42
39
  def includeFile(self):
43
40
  return "stop_button"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.text_box.text_box import TextBox
11
10
 
12
11
  DOM_XML = """
@@ -34,9 +33,7 @@ class TextBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
33
  return "BEC Utils"
35
34
 
36
35
  def icon(self):
37
- palette = QGuiApplication.palette()
38
- pixmap = material_icon("chat", color=palette.text().color(), filled=True)
39
- return QIcon(pixmap)
36
+ return designer_material_icon("chat")
40
37
 
41
38
  def includeFile(self):
42
39
  return "text_box"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.toggle.toggle import ToggleSwitch
11
10
 
12
11
  DOM_XML = """
@@ -35,9 +34,7 @@ class ToggleSwitchPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
35
34
  return "BEC Utils"
36
35
 
37
36
  def icon(self):
38
- palette = QGuiApplication.palette()
39
- pixmap = material_icon("toggle_on", color=palette.text().color(), filled=True)
40
- return QIcon(pixmap)
37
+ return designer_material_icon("toggle_on")
41
38
 
42
39
  def includeFile(self):
43
40
  return "toggle_switch"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.vscode.vscode import VSCodeEditor
11
10
 
12
11
  DOM_XML = """
@@ -35,9 +34,7 @@ class VSCodeEditorPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
35
34
  return "BEC Developer"
36
35
 
37
36
  def icon(self):
38
- palette = QGuiApplication.palette()
39
- pixmap = material_icon("developer_mode_tv", color=palette.text().color(), filled=True)
40
- return QIcon(pixmap)
37
+ return designer_material_icon("developer_mode_tv")
41
38
 
42
39
  def includeFile(self):
43
40
  return "vs_code_editor"
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.waveform.waveform_widget import BECWaveformWidget
11
10
 
12
11
  DOM_XML = """
@@ -35,9 +34,7 @@ class BECWaveformWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cov
35
34
  return "BEC Plots"
36
35
 
37
36
  def icon(self):
38
- palette = QGuiApplication.palette()
39
- pixmap = material_icon("show_chart", color=palette.text().color(), filled=True)
40
- return QIcon(pixmap)
37
+ return designer_material_icon("show_chart")
41
38
 
42
39
  def includeFile(self):
43
40
  return "bec_waveform_widget"
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import os
4
4
  from typing import Literal
5
5
 
6
+ from bec_qthemes import material_icon
6
7
  from pydantic import BaseModel
7
8
  from qtpy.QtCore import QObject, QSize, Slot
8
9
  from qtpy.QtGui import QIcon
@@ -38,10 +39,7 @@ class CurveSettings(SettingWidget):
38
39
  self.ui.normalize_colors_dap.clicked.connect(lambda: self.change_colormap("dap"))
39
40
 
40
41
  def _setup_icons(self):
41
- add_icon = QIcon()
42
- add_icon.addFile(
43
- os.path.join(MODULE_PATH, "assets", "toolbar_icons", "add.svg"), size=QSize(20, 20)
44
- )
42
+ add_icon = material_icon(icon_name="add", size=(20, 20), convert_to_pixmap=False)
45
43
  self.ui.add_dap.setIcon(add_icon)
46
44
  self.ui.add_dap.setToolTip("Add DAP Curve")
47
45
  self.ui.add_curve.setIcon(add_icon)
@@ -339,5 +337,5 @@ class StyleComboBox(QComboBox):
339
337
  class RemoveButton(QPushButton):
340
338
  def __init__(self, parent=None):
341
339
  super().__init__(parent)
342
- icon_path = os.path.join(MODULE_PATH, "assets", "toolbar_icons", "remove.svg")
343
- self.setIcon(QIcon(icon_path))
340
+ icon = material_icon("disabled_by_default", size=(20, 20), convert_to_pixmap=False)
341
+ self.setIcon(icon)
@@ -10,12 +10,7 @@ from qtpy.QtWidgets import QVBoxLayout, QWidget
10
10
 
11
11
  from bec_widgets.qt_utils.error_popups import SafeSlot, WarningPopupUtility
12
12
  from bec_widgets.qt_utils.settings_dialog import SettingsDialog
13
- from bec_widgets.qt_utils.toolbar import (
14
- IconAction,
15
- MaterialIconAction,
16
- ModularToolBar,
17
- SeparatorAction,
18
- )
13
+ from bec_widgets.qt_utils.toolbar import MaterialIconAction, ModularToolBar, SeparatorAction
19
14
  from bec_widgets.utils.bec_widget import BECWidget
20
15
  from bec_widgets.widgets.figure import BECFigure
21
16
  from bec_widgets.widgets.figure.plots.axis_settings import AxisSettings
@@ -88,24 +83,26 @@ class BECWaveformWidget(BECWidget, QWidget):
88
83
  self.fig = BECFigure()
89
84
  self.toolbar = ModularToolBar(
90
85
  actions={
91
- "save": IconAction(icon_path="save.svg", tooltip="Open Export Dialog"),
92
- "matplotlib": IconAction(
93
- icon_path="photo_library.svg", tooltip="Open Matplotlib Plot"
86
+ "save": MaterialIconAction(icon_name="save", tooltip="Open Export Dialog"),
87
+ "matplotlib": MaterialIconAction(
88
+ icon_name="photo_library", tooltip="Open Matplotlib Plot"
94
89
  ),
95
90
  "separator_1": SeparatorAction(),
96
- "drag_mode": IconAction(
97
- icon_path="drag_pan_mode.svg", tooltip="Drag Mouse Mode", checkable=True
91
+ "drag_mode": MaterialIconAction(
92
+ icon_name="drag_pan", tooltip="Drag Mouse Mode", checkable=True
93
+ ),
94
+ "rectangle_mode": MaterialIconAction(
95
+ icon_name="frame_inspect", tooltip="Rectangle Zoom Mode", checkable=True
98
96
  ),
99
- "rectangle_mode": IconAction(
100
- icon_path="rectangle_mode.svg", tooltip="Rectangle Zoom Mode", checkable=True
97
+ "auto_range": MaterialIconAction(
98
+ icon_name="open_in_full", tooltip="Autorange Plot"
101
99
  ),
102
- "auto_range": IconAction(icon_path="auto_range.svg", tooltip="Autorange Plot"),
103
100
  "separator_2": SeparatorAction(),
104
- "curves": IconAction(
105
- icon_path="line_axis.svg", tooltip="Open Curves Configuration"
101
+ "curves": MaterialIconAction(
102
+ icon_name="stacked_line_chart", tooltip="Open Curves Configuration"
106
103
  ),
107
- "fit_params": IconAction(
108
- icon_path="fitting_parameters.svg", tooltip="Open Fitting Parameters"
104
+ "fit_params": MaterialIconAction(
105
+ icon_name="monitoring", tooltip="Open Fitting Parameters"
109
106
  ),
110
107
  "axis_settings": MaterialIconAction(
111
108
  icon_name="settings", tooltip="Open Configuration Dialog"
@@ -594,10 +591,12 @@ class BECWaveformWidget(BECWidget, QWidget):
594
591
 
595
592
 
596
593
  def main(): # pragma: no cover
597
-
598
594
  from qtpy.QtWidgets import QApplication
599
595
 
596
+ from bec_widgets.utils.colors import set_theme
597
+
600
598
  app = QApplication(sys.argv)
599
+ set_theme("auto")
601
600
  widget = BECWaveformWidget()
602
601
  widget.show()
603
602
  sys.exit(app.exec_())
@@ -2,11 +2,10 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
  import os
4
4
 
5
- from bec_qthemes import material_icon
6
5
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
- from qtpy.QtGui import QGuiApplication, QIcon
8
6
 
9
7
  import bec_widgets
8
+ from bec_widgets.utils.bec_designer import designer_material_icon
10
9
  from bec_widgets.widgets.website.website import WebsiteWidget
11
10
 
12
11
  DOM_XML = """
@@ -34,9 +33,7 @@ class WebsiteWidgetPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
33
  return "BEC Utils"
35
34
 
36
35
  def icon(self):
37
- palette = QGuiApplication.palette()
38
- pixmap = material_icon("travel_explore", color=palette.text().color(), filled=True)
39
- return QIcon(pixmap)
36
+ return designer_material_icon("travel_explore")
40
37
 
41
38
  def includeFile(self):
42
39
  return "website_widget"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.96.3
3
+ Version: 0.98.0
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets