bec-widgets 0.99.1__py3-none-any.whl → 0.99.9__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 (250) hide show
  1. .gitlab-ci.yml +0 -1
  2. CHANGELOG.md +76 -70
  3. PKG-INFO +2 -2
  4. bec_widgets/cli/client.py +3 -3
  5. bec_widgets/qt_utils/toolbar.py +11 -5
  6. bec_widgets/utils/bec_widget.py +11 -2
  7. bec_widgets/utils/colors.py +18 -2
  8. bec_widgets/utils/plugin_templates/plugin.template +2 -2
  9. bec_widgets/widgets/bec_queue/bec_queue.py +2 -0
  10. bec_widgets/widgets/bec_queue/bec_queue_plugin.py +1 -1
  11. bec_widgets/widgets/bec_status_box/bec_status_box.py +2 -0
  12. bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +1 -1
  13. bec_widgets/widgets/color_button/color_button.py +2 -0
  14. bec_widgets/widgets/color_button/color_button_plugin.py +1 -1
  15. bec_widgets/widgets/colormap_selector/colormap_selector.py +1 -0
  16. bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py +1 -1
  17. bec_widgets/widgets/dark_mode_button/dark_mode_button.py +12 -3
  18. bec_widgets/widgets/dark_mode_button/dark_mode_button_plugin.py +1 -1
  19. bec_widgets/widgets/device_browser/device_browser.py +2 -0
  20. bec_widgets/widgets/device_browser/device_browser_plugin.py +1 -1
  21. bec_widgets/widgets/device_combobox/device_combo_box_plugin.py +1 -1
  22. bec_widgets/widgets/device_combobox/device_combobox.py +2 -0
  23. bec_widgets/widgets/device_line_edit/device_line_edit.py +2 -0
  24. bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +1 -1
  25. bec_widgets/widgets/dock/dock.py +1 -0
  26. bec_widgets/widgets/dock/dock_area.py +30 -10
  27. bec_widgets/widgets/dock/dock_area_plugin.py +1 -1
  28. bec_widgets/widgets/figure/figure.py +1 -1
  29. bec_widgets/widgets/figure/plots/waveform/waveform.py +12 -7
  30. bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +3 -3
  31. bec_widgets/widgets/image/bec_image_widget_plugin.py +1 -1
  32. bec_widgets/widgets/image/image_widget.py +1 -0
  33. bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py +1 -1
  34. bec_widgets/widgets/motor_map/motor_map_widget.py +1 -0
  35. bec_widgets/widgets/position_indicator/position_indicator.py +2 -0
  36. bec_widgets/widgets/position_indicator/position_indicator_plugin.py +1 -1
  37. bec_widgets/widgets/positioner_box/positioner_box.py +1 -0
  38. bec_widgets/widgets/positioner_box/positioner_box_plugin.py +1 -1
  39. bec_widgets/widgets/positioner_box/positioner_control_line.py +2 -0
  40. bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +1 -1
  41. bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +1 -0
  42. bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +1 -1
  43. bec_widgets/widgets/scan_control/scan_control.py +2 -0
  44. bec_widgets/widgets/scan_control/scan_control_plugin.py +1 -4
  45. bec_widgets/widgets/spinner/spinner.py +2 -0
  46. bec_widgets/widgets/spinner/spinner_widget_plugin.py +1 -1
  47. bec_widgets/widgets/stop_button/stop_button.py +2 -0
  48. bec_widgets/widgets/stop_button/stop_button_plugin.py +1 -1
  49. bec_widgets/widgets/text_box/text_box.py +1 -0
  50. bec_widgets/widgets/text_box/text_box_plugin.py +1 -1
  51. bec_widgets/widgets/toggle/toggle.py +1 -0
  52. bec_widgets/widgets/toggle/toggle_switch_plugin.py +1 -1
  53. bec_widgets/widgets/vscode/vs_code_editor_plugin.py +1 -1
  54. bec_widgets/widgets/vscode/vscode.py +1 -0
  55. bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +1 -1
  56. bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +14 -13
  57. bec_widgets/widgets/waveform/waveform_widget.py +3 -2
  58. bec_widgets/widgets/website/website.py +42 -10
  59. bec_widgets/widgets/website/website_widget_plugin.py +1 -1
  60. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/METADATA +2 -2
  61. bec_widgets-0.99.9.dist-info/RECORD +231 -0
  62. pyproject.toml +7 -2
  63. bec_widgets/assets/toolbar_icons/add.svg +0 -3
  64. bec_widgets/assets/toolbar_icons/attach_all.svg +0 -3
  65. bec_widgets/assets/toolbar_icons/auto_range.svg +0 -3
  66. bec_widgets/assets/toolbar_icons/compare.svg +0 -3
  67. bec_widgets/assets/toolbar_icons/connection.svg +0 -4
  68. bec_widgets/assets/toolbar_icons/device_line_edit.svg +0 -3
  69. bec_widgets/assets/toolbar_icons/drag_pan_mode.svg +0 -3
  70. bec_widgets/assets/toolbar_icons/export.svg +0 -9
  71. bec_widgets/assets/toolbar_icons/fft.svg +0 -11
  72. bec_widgets/assets/toolbar_icons/fitting_parameters.svg +0 -3
  73. bec_widgets/assets/toolbar_icons/history.svg +0 -4
  74. bec_widgets/assets/toolbar_icons/image.svg +0 -3
  75. bec_widgets/assets/toolbar_icons/image_autorange.svg +0 -3
  76. bec_widgets/assets/toolbar_icons/import.svg +0 -9
  77. bec_widgets/assets/toolbar_icons/line_axis.svg +0 -3
  78. bec_widgets/assets/toolbar_icons/line_curve.svg +0 -3
  79. bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +0 -3
  80. bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
  81. bec_widgets/assets/toolbar_icons/motor_map.svg +0 -3
  82. bec_widgets/assets/toolbar_icons/photo_library.svg +0 -3
  83. bec_widgets/assets/toolbar_icons/positioner_box.svg +0 -3
  84. bec_widgets/assets/toolbar_icons/progress.svg +0 -3
  85. bec_widgets/assets/toolbar_icons/queue.svg +0 -3
  86. bec_widgets/assets/toolbar_icons/rectangle_mode.svg +0 -3
  87. bec_widgets/assets/toolbar_icons/remove.svg +0 -5
  88. bec_widgets/assets/toolbar_icons/reset_settings.svg +0 -3
  89. bec_widgets/assets/toolbar_icons/restore_state.svg +0 -3
  90. bec_widgets/assets/toolbar_icons/ring_progress.svg +0 -3
  91. bec_widgets/assets/toolbar_icons/rotate_left.svg +0 -3
  92. bec_widgets/assets/toolbar_icons/rotate_right.svg +0 -3
  93. bec_widgets/assets/toolbar_icons/save.svg +0 -3
  94. bec_widgets/assets/toolbar_icons/save_state.svg +0 -3
  95. bec_widgets/assets/toolbar_icons/scan_control.svg +0 -3
  96. bec_widgets/assets/toolbar_icons/settings.svg +0 -4
  97. bec_widgets/assets/toolbar_icons/status.svg +0 -3
  98. bec_widgets/assets/toolbar_icons/terminal.svg +0 -3
  99. bec_widgets/assets/toolbar_icons/transform.svg +0 -3
  100. bec_widgets/assets/toolbar_icons/waveform.svg +0 -3
  101. bec_widgets-0.99.1.dist-info/RECORD +0 -415
  102. docs/Makefile +0 -20
  103. docs/_static/custom.css +0 -170
  104. docs/_templates/custom-class-template.rst +0 -34
  105. docs/_templates/custom-module-template.rst +0 -66
  106. docs/api_reference/api_reference.md +0 -12
  107. docs/assets/apps_48dp.svg +0 -1
  108. docs/assets/display_settings_48dp.svg +0 -1
  109. docs/assets/index_api.svg +0 -97
  110. docs/assets/index_contribute.svg +0 -76
  111. docs/assets/index_getting_started.svg +0 -66
  112. docs/assets/index_user_guide.svg +0 -67
  113. docs/assets/rocket_launch_48dp.svg +0 -1
  114. docs/assets/widget_screenshots/buttons.png +0 -0
  115. docs/assets/widget_screenshots/device_box.png +0 -0
  116. docs/assets/widget_screenshots/device_browser.png +0 -0
  117. docs/assets/widget_screenshots/device_inputs.png +0 -0
  118. docs/assets/widget_screenshots/dock_area.png +0 -0
  119. docs/assets/widget_screenshots/figure.png +0 -0
  120. docs/assets/widget_screenshots/image_widget.png +0 -0
  121. docs/assets/widget_screenshots/motor_map_widget.png +0 -0
  122. docs/assets/widget_screenshots/position_indicator.png +0 -0
  123. docs/assets/widget_screenshots/queue.png +0 -0
  124. docs/assets/widget_screenshots/ring_progress_bar.png +0 -0
  125. docs/assets/widget_screenshots/scan_controller.png +0 -0
  126. docs/assets/widget_screenshots/spinner.gif +0 -0
  127. docs/assets/widget_screenshots/status_box.png +0 -0
  128. docs/assets/widget_screenshots/text_box.png +0 -0
  129. docs/assets/widget_screenshots/toggle.png +0 -0
  130. docs/assets/widget_screenshots/waveform_widget.png +0 -0
  131. docs/assets/widget_screenshots/website.png +0 -0
  132. docs/conf.py +0 -82
  133. docs/developer/developer.md +0 -52
  134. docs/developer/introduction/concepts.md +0 -14
  135. docs/developer/introduction/contributing.md +0 -28
  136. docs/developer/introduction/introduction.md +0 -16
  137. docs/developer/introduction/useful_links.md +0 -23
  138. docs/developer/widget_development/bec_dispatcher.md +0 -143
  139. docs/developer/widget_development/widget_development.md +0 -13
  140. docs/index.md +0 -74
  141. docs/introduction/introduction.md +0 -18
  142. docs/make.bat +0 -35
  143. docs/requirements.txt +0 -12
  144. docs/user/api_reference/api_reference.md +0 -11
  145. docs/user/applications/applications.md +0 -10
  146. docs/user/customisation.md +0 -123
  147. docs/user/getting_started/BECDockArea.png +0 -0
  148. docs/user/getting_started/auto_updates.md +0 -82
  149. docs/user/getting_started/getting_started.md +0 -15
  150. docs/user/getting_started/gui_complex_gui.gif +0 -0
  151. docs/user/getting_started/installation.md +0 -33
  152. docs/user/getting_started/quick_start.md +0 -110
  153. docs/user/getting_started/video_tutorials.md +0 -17
  154. docs/user/user.md +0 -71
  155. docs/user/widgets/bec_figure/BECFigure.png +0 -0
  156. docs/user/widgets/bec_figure/bec_figure.md +0 -105
  157. docs/user/widgets/bec_status_box/bec_status_box.gif +0 -0
  158. docs/user/widgets/bec_status_box/bec_status_box.md +0 -38
  159. docs/user/widgets/buttons/buttons.md +0 -63
  160. docs/user/widgets/buttons/dark_mode_disabled.png +0 -0
  161. docs/user/widgets/buttons/dark_mode_enabled.png +0 -0
  162. docs/user/widgets/device_browser/device_browser.md +0 -36
  163. docs/user/widgets/device_browser/device_browser.png +0 -0
  164. docs/user/widgets/device_input/device_input.md +0 -100
  165. docs/user/widgets/dock_area/BECDockArea.png +0 -0
  166. docs/user/widgets/dock_area/bec_dock_area.md +0 -107
  167. docs/user/widgets/image/image_plot.gif +0 -0
  168. docs/user/widgets/image/image_widget.md +0 -84
  169. docs/user/widgets/motor_map/motor.gif +0 -0
  170. docs/user/widgets/motor_map/motor_map.md +0 -80
  171. docs/user/widgets/position_indicator/position_indicator.md +0 -76
  172. docs/user/widgets/positioner_box/positioner_box.md +0 -63
  173. docs/user/widgets/progress_bar/progress_bar.gif +0 -0
  174. docs/user/widgets/progress_bar/ring_progress_bar.md +0 -103
  175. docs/user/widgets/queue/queue.md +0 -41
  176. docs/user/widgets/scan_control/hide_scan_control.png +0 -0
  177. docs/user/widgets/scan_control/scan_control.gif +0 -0
  178. docs/user/widgets/scan_control/scan_control.md +0 -54
  179. docs/user/widgets/spinner/spinner.md +0 -75
  180. docs/user/widgets/text_box/text_box.md +0 -74
  181. docs/user/widgets/toggle/toggle.md +0 -66
  182. docs/user/widgets/waveform/bec_figure_dap.gif +0 -0
  183. docs/user/widgets/waveform/scatter_2D.gif +0 -0
  184. docs/user/widgets/waveform/w1D.gif +0 -0
  185. docs/user/widgets/waveform/waveform_widget.md +0 -132
  186. docs/user/widgets/website/website.md +0 -69
  187. docs/user/widgets/widgets.md +0 -220
  188. tests/__init__.py +0 -0
  189. tests/end-2-end/__init__.py +0 -0
  190. tests/end-2-end/conftest.py +0 -53
  191. tests/end-2-end/test_bec_dock_rpc_e2e.py +0 -298
  192. tests/end-2-end/test_bec_figure_rpc_e2e.py +0 -212
  193. tests/end-2-end/test_rpc_register_e2e.py +0 -40
  194. tests/end-2-end/test_scan_control_e2e.py +0 -71
  195. tests/references/SpinnerWidget/SpinnerWidget_darwin.png +0 -0
  196. tests/references/SpinnerWidget/SpinnerWidget_linux.png +0 -0
  197. tests/references/SpinnerWidget/SpinnerWidget_started_darwin.png +0 -0
  198. tests/references/SpinnerWidget/SpinnerWidget_started_linux.png +0 -0
  199. tests/unit_tests/__init__.py +0 -0
  200. tests/unit_tests/client_mocks.py +0 -189
  201. tests/unit_tests/conftest.py +0 -64
  202. tests/unit_tests/test_bec_connector.py +0 -80
  203. tests/unit_tests/test_bec_dispatcher.py +0 -119
  204. tests/unit_tests/test_bec_dock.py +0 -155
  205. tests/unit_tests/test_bec_figure.py +0 -270
  206. tests/unit_tests/test_bec_image.py +0 -63
  207. tests/unit_tests/test_bec_image_widget.py +0 -217
  208. tests/unit_tests/test_bec_motor_map.py +0 -282
  209. tests/unit_tests/test_bec_queue.py +0 -111
  210. tests/unit_tests/test_bec_status_box.py +0 -123
  211. tests/unit_tests/test_client_utils.py +0 -76
  212. tests/unit_tests/test_color_map_selector.py +0 -42
  213. tests/unit_tests/test_color_validation.py +0 -75
  214. tests/unit_tests/test_configs/config_device.yaml +0 -33
  215. tests/unit_tests/test_configs/config_device_no_entry.yaml +0 -27
  216. tests/unit_tests/test_configs/config_scan.yaml +0 -82
  217. tests/unit_tests/test_crosshair.py +0 -143
  218. tests/unit_tests/test_dark_mode_button.py +0 -70
  219. tests/unit_tests/test_device_browser.py +0 -83
  220. tests/unit_tests/test_device_input_base.py +0 -76
  221. tests/unit_tests/test_device_input_widgets.py +0 -178
  222. tests/unit_tests/test_error_utils.py +0 -63
  223. tests/unit_tests/test_generate_cli_client.py +0 -123
  224. tests/unit_tests/test_generate_plugin.py +0 -155
  225. tests/unit_tests/test_motor_map_widget.py +0 -194
  226. tests/unit_tests/test_msgs/__init__.py +0 -0
  227. tests/unit_tests/test_msgs/available_scans_message.py +0 -989
  228. tests/unit_tests/test_plot_base.py +0 -95
  229. tests/unit_tests/test_plugin_utils.py +0 -13
  230. tests/unit_tests/test_positioner_box.py +0 -130
  231. tests/unit_tests/test_ring_progress_bar.py +0 -337
  232. tests/unit_tests/test_rpc_register.py +0 -52
  233. tests/unit_tests/test_rpc_server.py +0 -42
  234. tests/unit_tests/test_rpc_widget_handler.py +0 -7
  235. tests/unit_tests/test_scan_control.py +0 -324
  236. tests/unit_tests/test_scan_control_group_box.py +0 -160
  237. tests/unit_tests/test_setting_dialog.py +0 -96
  238. tests/unit_tests/test_spinner.py +0 -31
  239. tests/unit_tests/test_stop_button.py +0 -27
  240. tests/unit_tests/test_text_box_widget.py +0 -54
  241. tests/unit_tests/test_toggle.py +0 -38
  242. tests/unit_tests/test_vscode_widget.py +0 -75
  243. tests/unit_tests/test_waveform1d.py +0 -712
  244. tests/unit_tests/test_waveform_widget.py +0 -462
  245. tests/unit_tests/test_website_widget.py +0 -25
  246. tests/unit_tests/test_widget_io.py +0 -90
  247. tests/unit_tests/test_yaml_dialog.py +0 -163
  248. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/WHEEL +0 -0
  249. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/entry_points.txt +0 -0
  250. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/licenses/LICENSE +0 -0
.gitlab-ci.yml CHANGED
@@ -178,7 +178,6 @@ test-matrix:
178
178
  - *install-repos
179
179
  - pip install -e .[dev,$QT_PCKG]
180
180
  - pytest -v --maxfail=2 --junitxml=report.xml --random-order ./tests/unit_tests
181
- allow_failure: true
182
181
 
183
182
  end-2-end-conda:
184
183
  stage: End2End
CHANGELOG.md CHANGED
@@ -1,155 +1,161 @@
1
1
  # CHANGELOG
2
2
 
3
- ## v0.99.1 (2024-08-27)
3
+ ## v0.99.9 (2024-08-28)
4
4
 
5
5
  ### Fix
6
6
 
7
- * fix(crosshair): emit all crosshair events, not just line coordinates ([`2265458`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2265458dcc57970db18c62619f5877d542d72e81))
7
+ * fix: fixed build process and excluded docs and tests from tarballs and wheels ([`719254c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/719254cf0a48e1fc4bd541edba239570778bcfea))
8
8
 
9
- ## v0.99.0 (2024-08-25)
9
+ ## v0.99.8 (2024-08-28)
10
10
 
11
- ### Documentation
11
+ ### Fix
12
12
 
13
- * docs(darkmodebutton): added dark mode button docs ([`406c263`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/406c263746f0e809c1a4d98356c48f40428c23d7))
13
+ * fix(website): fixed designer integration for website widget ([`5f37e86`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5f37e862c95ac7173b6918ad39bcaef938dad698))
14
14
 
15
- ### Feature
15
+ ### Refactor
16
16
 
17
- * feat(darkmodebutton): added button to toggle between dark and light mode ([`cc8c166`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cc8c166b5c1d37e0f64c83801b2347a54a6550b6))
17
+ * refactor(website): changed inheritance of website widget to simple qwidget; closes #325 ([`9925bbd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9925bbdb48b55eacbbce9fd6a1555a21b84221f9))
18
+
19
+ ## v0.99.7 (2024-08-28)
18
20
 
19
21
  ### Fix
20
22
 
21
- * fix(toggle): emit state change ([`c4f3308`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c4f3308dc0c3e4b2064760ccd7372d71b3e49f96))
23
+ * fix(toolbar): material icons can accept color as kwarg ([`ffc871e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ffc871ebbd3b68abc3e151bb8f5849e6c50e775e))
22
24
 
23
- ### Refactor
25
+ ## v0.99.6 (2024-08-28)
24
26
 
25
- * refactor(darkmodebutton): renamed set_dark_mode_enabled to toggle_dark_mode ([`c70724a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c70724a456900bcb06b040407a2c5d497e49ce77))
27
+ ### Documentation
26
28
 
27
- ### Test
29
+ * docs: various bugs fixed ([`c31e9a3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c31e9a3aff3ee8e984674dee0965ee7f1b6e2b8f))
28
30
 
29
- * test(dark_mode_button): added tests for dark mode button ([`df35aab`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df35aabff30c5d00b1c441132bd370446653741e))
31
+ ### Fix
30
32
 
31
- ## v0.98.0 (2024-08-25)
33
+ * fix(toolbar): use of native qt separators ([`09c6c93`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/09c6c93c397ce4a21c293f6c79106c74b2db65ca))
32
34
 
33
- ### Feature
35
+ ## v0.99.5 (2024-08-28)
34
36
 
35
- * feat(themes): added set_theme method ([`2b4449a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2b4449afebdda0a97f95712a1353cf40ec55c283))
37
+ ### Documentation
38
+
39
+ * docs(index): index page is centered ([`02239de`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/02239de0a36fcd6cbf97990b0dec1ddf7ecf6ba6))
36
40
 
37
41
  ### Fix
38
42
 
39
- * fix(toolbar): removed hardcoded color values ([`afdf4e8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/afdf4e8782a22566932180224fa1c924d24c810f))
43
+ * fix(dock_area): dark button added ([`e6f204b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e6f204b6aa295747a68769f43af2e549149b401a))
40
44
 
41
- * fix: transitioning to material icons ([`2a82032`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2a82032644a84e38df04e2035a6aa63f4a046360))
45
+ ## v0.99.4 (2024-08-28)
42
46
 
43
- * fix(dock_area): transitioned to MaterialIconAction ([`88a2f66`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/88a2f667588e9aeb34ae556fa327898824052bc3))
47
+ ### Documentation
44
48
 
45
- * fix: fix color palette if qtheme was not called ([`3f3b207`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3f3b207295ebd406ebaeecee465c774965161b8b))
49
+ * docs(buttons): added missing buttons docs ([`4e5520a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4e5520aee2115d2fc0cebb3865433478a5ec8253))
46
50
 
47
- * fix(figure): removed theme from figure init ([`e42b84c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e42b84c63650297d67feffccc02a2c2ba111ca79))
51
+ * docs(developer): tutorial for BECWidget base class ([`ac2cb51`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ac2cb5197deef4d51e26ee5beb070eba3ffc210d))
48
52
 
49
- * fix: use globally set theme instead of the internal bec widgets theme ([`77c5aa7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/77c5aa741cf1f5b969a42aa878aa2965176dbf41))
53
+ ### Fix
50
54
 
51
- * fix(waveform): fixed icon appearance ([`36ad464`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/36ad4641594b67c9b789515c28f7db78a12757ee))
55
+ * fix(theme): apply theme to all pyqtgraph widgets on manual updates ([`c550186`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c5501860e8e07a53f4bce144d44ed39eda6290ef))
52
56
 
53
57
  ### Refactor
54
58
 
55
- * refactor(waveform): use set theme for demo ([`44cfda1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44cfda1c07306669c9a4e09706d95e6b91dee370))
59
+ * refactor(buttons): changed grid and thumbnail fig in gallery ([`4591ba8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4591ba8f73e22aba7258cad93c073f1387cb74a0))
56
60
 
57
- ## v0.97.0 (2024-08-23)
61
+ * refactor(icons): removed toolbar icons from assets ([`f335763`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f335763280adb1d83ba31f073ce206e4cb5d15ef))
58
62
 
59
- ### Feature
63
+ * refactor(icons): moved widget icons to class attribute ICON_NAME ([`e890091`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e890091d862e42317c7a54fc414ba37c85f268b0))
60
64
 
61
- * feat(designer): added designer icon factory ([`82a55dd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/82a55ddf3eafb589cb63408db1c0e7e5c9d629da))
65
+ ## v0.99.3 (2024-08-27)
62
66
 
63
- ### Fix
67
+ ### Build
64
68
 
65
- * fix(toolbar icon): fixed material icon toolbar for theme changes ([`3ecbd60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3ecbd60627994417c9175364e5909710dbcdceb2))
69
+ * build: updated min version of bec qthemes ([`d482434`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d48243483ef8228cc5eb85e40a6b8f5da3b45520))
66
70
 
67
- ## v0.96.3 (2024-08-23)
71
+ ### Fix
68
72
 
69
- ### Documentation
73
+ * fix(cmaps): unified all defaults to magma cmap ([`1ca9499`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1ca9499edd334c19fe1e7aac71d3940a80a1ec95))
70
74
 
71
- * docs(dispatcher): docs added ([`dd7c71b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd7c71bb1e0b7ef5398b1e1a05fc1147c772420a))
75
+ * fix(color maps): color maps should take the background color into account; fixed min colors to 10 ([`060935f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/060935ffc5472a958c337bf60834c5291f104ece))
72
76
 
73
- ### Fix
77
+ ## v0.99.2 (2024-08-27)
74
78
 
75
- * fix: minor fixes for type annotations ([`8c2e7c8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8c2e7c82592ace50e4e1f47e392a0ddc988f57ae))
79
+ ### Ci
76
80
 
77
- ## v0.96.2 (2024-08-22)
81
+ * ci: additional tests are not allowed to fail ([`bb385f0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/bb385f07ca18904461a541b5cadde05398c84438))
78
82
 
79
83
  ### Fix
80
84
 
81
- * fix(waveform): validation of custom curves removed ([`af28574`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/af28574bd58457a05f1269f121db01ad627b5769))
85
+ * fix(widgets): fixed default theme for widgets
86
+
87
+ If not theme is set, the init of the BECWidget base class sets the default theme to "dark" ([`cf28730`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cf28730515e3c2d5914e0205768734c578711e5c))
82
88
 
83
- * fix(waveform): skip validation for curves that are not BECCurve instances ([`617db36`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/617db36ed4932c8a0633724079b695bc67d5c77b))
89
+ ## v0.99.1 (2024-08-27)
84
90
 
85
- ## v0.96.1 (2024-08-22)
91
+ ### Fix
86
92
 
87
- ### Ci
93
+ * fix(crosshair): emit all crosshair events, not just line coordinates ([`2265458`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2265458dcc57970db18c62619f5877d542d72e81))
88
94
 
89
- * ci: fail pytest after 2 failed tests ([`f0203d9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f0203d9bf60c4975ba5ab93a057d9091762454d5))
95
+ ## v0.99.0 (2024-08-25)
90
96
 
91
- ### Fix
97
+ ### Documentation
92
98
 
93
- * fix(crosshair): update markers if necessary ([`4473805`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44738057a36f5de2bbb55affdd309f92286d4a0f))
99
+ * docs(darkmodebutton): added dark mode button docs ([`406c263`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/406c263746f0e809c1a4d98356c48f40428c23d7))
94
100
 
95
- * fix(waveform_widget): fixed icon appearance ([`f98a9f9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f98a9f9771b93226d47830aa52f45739624f51b4))
101
+ ### Feature
96
102
 
97
- * fix: bubble-up signals ([`2fe72c9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2fe72c9ccb71bcb196a1b78197b73acf9aa3f506))
103
+ * feat(darkmodebutton): added button to toggle between dark and light mode ([`cc8c166`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cc8c166b5c1d37e0f64c83801b2347a54a6550b6))
98
104
 
99
- * fix(crosshair): fixed crosshair for image and waveforms ([`37835cb`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/37835cbf76ca3ba1081f514ee7793244ac500e7f))
105
+ ### Fix
100
106
 
101
- ## v0.96.0 (2024-08-22)
107
+ * fix(toggle): emit state change ([`c4f3308`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c4f3308dc0c3e4b2064760ccd7372d71b3e49f96))
102
108
 
103
- ### Documentation
109
+ ### Refactor
104
110
 
105
- * docs(scan_control): added designer options ([`9d7718c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9d7718c3d9badf14150174410b9958a3134a1e23))
111
+ * refactor(darkmodebutton): renamed set_dark_mode_enabled to toggle_dark_mode ([`c70724a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c70724a456900bcb06b040407a2c5d497e49ce77))
106
112
 
107
- ### Feature
113
+ ### Test
108
114
 
109
- * feat(scan_control): added the ability to configure the scan control widget from designer ([`9d8fb0b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9d8fb0b761efa92972399bcd9aea28e956074380))
115
+ * test(dark_mode_button): added tests for dark mode button ([`df35aab`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df35aabff30c5d00b1c441132bd370446653741e))
110
116
 
111
- ## v0.95.1 (2024-08-22)
117
+ ## v0.98.0 (2024-08-25)
112
118
 
113
- ### Documentation
119
+ ### Feature
114
120
 
115
- * docs: links section added ([`2bf5c70`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2bf5c7096e7d822713e1b50bde89f072e6356e17))
121
+ * feat(themes): added set_theme method ([`2b4449a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2b4449afebdda0a97f95712a1353cf40ec55c283))
116
122
 
117
123
  ### Fix
118
124
 
119
- * fix(docs): changed link to scan gui config in main docs ([`640464a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/640464a6543b2111bdb58d0174f2ce86c5836cbe))
125
+ * fix(toolbar): removed hardcoded color values ([`afdf4e8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/afdf4e8782a22566932180224fa1c924d24c810f))
120
126
 
121
- ### Refactor
127
+ * fix: transitioning to material icons ([`2a82032`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2a82032644a84e38df04e2035a6aa63f4a046360))
122
128
 
123
- * refactor: removed designer pngs ([`84abe46`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/84abe460502d838aac41bb8ff63d93c9fcec9214))
129
+ * fix(dock_area): transitioned to MaterialIconAction ([`88a2f66`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/88a2f667588e9aeb34ae556fa327898824052bc3))
124
130
 
125
- * refactor: moved to dynamically loaded material design icons ([`1d2afaa`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1d2afaa09e64b7f714d72796e87e2cb49b2a75a7))
131
+ * fix: fix color palette if qtheme was not called ([`3f3b207`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3f3b207295ebd406ebaeecee465c774965161b8b))
126
132
 
127
- ## v0.95.0 (2024-08-21)
133
+ * fix(figure): removed theme from figure init ([`e42b84c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e42b84c63650297d67feffccc02a2c2ba111ca79))
128
134
 
129
- ### Documentation
135
+ * fix: use globally set theme instead of the internal bec widgets theme ([`77c5aa7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/77c5aa741cf1f5b969a42aa878aa2965176dbf41))
130
136
 
131
- * docs(device_browser): added user docs ([`2c31cc9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2c31cc90ae751f14a653cbbdd6c353d6359aaafe))
137
+ * fix(waveform): fixed icon appearance ([`36ad464`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/36ad4641594b67c9b789515c28f7db78a12757ee))
132
138
 
133
- * docs(user): widget gallery with documentation added ([`7357f3d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7357f3d2a189f9f04954a027f39ce07c394d57ec))
139
+ ### Refactor
134
140
 
135
- * docs: added sphinx-inline-tabs as sphinx dependency ([`e9ecd26`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e9ecd268c602ea9572df0e8d508e49ee62d0c170))
141
+ * refactor(waveform): use set theme for demo ([`44cfda1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44cfda1c07306669c9a4e09706d95e6b91dee370))
136
142
 
137
- * docs(cards): changed index cards to custom css class instead of overwriting the default sd-card theme ([`91ba30e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/91ba30e8d054a9c7f6c6d98b21113a5d0b1bbbbb))
143
+ ## v0.97.0 (2024-08-23)
138
144
 
139
145
  ### Feature
140
146
 
141
- * feat(cli): added device_browser to cli ([`196504b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/196504b533367a899c19b88af4ccd5b39dc46aac))
142
-
143
- * feat(widgets): added device_browser widget ([`73f5a2f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/73f5a2f085b289ac18fa8a918b6ad7cfed595fb4))
147
+ * feat(designer): added designer icon factory ([`82a55dd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/82a55ddf3eafb589cb63408db1c0e7e5c9d629da))
144
148
 
145
149
  ### Fix
146
150
 
147
- * fix(device_browser): fixed plugin assignment for designer ([`6500393`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/650039303aae9bbec62c676285938416fff146ce))
151
+ * fix(toolbar icon): fixed material icon toolbar for theme changes ([`3ecbd60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3ecbd60627994417c9175364e5909710dbcdceb2))
148
152
 
149
- ### Refactor
153
+ ## v0.96.3 (2024-08-23)
150
154
 
151
- * refactor(docs): review response ([`4790afd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4790afde3d61fc9beb073c2775c339d4f80779e3))
155
+ ### Documentation
152
156
 
153
- ### Test
157
+ * docs(dispatcher): docs added ([`dd7c71b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd7c71bb1e0b7ef5398b1e1a05fc1147c772420a))
154
158
 
155
- * test: added test for device browser ([`e870e5b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e870e5ba083c61df581c9c0305adabe72967f997))
159
+ ### Fix
160
+
161
+ * fix: minor fixes for type annotations ([`8c2e7c8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8c2e7c82592ace50e4e1f47e392a0ddc988f57ae))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.99.1
3
+ Version: 0.99.9
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
@@ -11,7 +11,7 @@ Classifier: Topic :: Scientific/Engineering
11
11
  Requires-Python: >=3.10
12
12
  Requires-Dist: bec-ipython-client>=2.21.4,~=2.21
13
13
  Requires-Dist: bec-lib>=2.21.4,~=2.21
14
- Requires-Dist: bec-qthemes~=0.0
14
+ Requires-Dist: bec-qthemes>=0.4.2,~=0.4
15
15
  Requires-Dist: black~=24.0
16
16
  Requires-Dist: isort>=5.13.2,~=5.13
17
17
  Requires-Dist: pydantic~=2.0
bec_widgets/cli/client.py CHANGED
@@ -483,7 +483,7 @@ class BECFigure(RPCBase):
483
483
  y_entry: "str | None" = None,
484
484
  z_entry: "str | None" = None,
485
485
  color: "str | None" = None,
486
- color_map_z: "str | None" = "plasma",
486
+ color_map_z: "str | None" = "magma",
487
487
  label: "str | None" = None,
488
488
  validate: "bool" = True,
489
489
  new: "bool" = False,
@@ -1728,7 +1728,7 @@ class BECWaveform(RPCBase):
1728
1728
  y_entry: "str | None" = None,
1729
1729
  z_entry: "str | None" = None,
1730
1730
  color: "str | None" = None,
1731
- color_map_z: "str | None" = "plasma",
1731
+ color_map_z: "str | None" = "magma",
1732
1732
  label: "str | None" = None,
1733
1733
  validate: "bool" = True,
1734
1734
  dap: "str | None" = None,
@@ -2042,7 +2042,7 @@ class BECWaveformWidget(RPCBase):
2042
2042
  y_entry: "str | None" = None,
2043
2043
  z_entry: "str | None" = None,
2044
2044
  color: "str | None" = None,
2045
- color_map_z: "str | None" = "plasma",
2045
+ color_map_z: "str | None" = "magma",
2046
2046
  label: "str | None" = None,
2047
2047
  validate: "bool" = True,
2048
2048
  dap: "str | None" = None,
@@ -2,10 +2,11 @@
2
2
  import os
3
3
  from abc import ABC, abstractmethod
4
4
  from collections import defaultdict
5
+ from typing import Literal
5
6
 
6
7
  from bec_qthemes._icon.material_icons import material_icon
7
8
  from qtpy.QtCore import QSize
8
- from qtpy.QtGui import QAction, QIcon
9
+ from qtpy.QtGui import QAction, QColor, QIcon
9
10
  from qtpy.QtWidgets import QHBoxLayout, QLabel, QMenu, QToolBar, QToolButton, QWidget
10
11
 
11
12
  import bec_widgets
@@ -45,9 +46,7 @@ class SeparatorAction(ToolBarAction):
45
46
  """Separator action for the toolbar."""
46
47
 
47
48
  def add_to_toolbar(self, toolbar: QToolBar, target: QWidget):
48
- self.separator = QToolButton()
49
- self.separator.setFixedSize(2, 22)
50
- toolbar.addWidget(self.separator)
49
+ toolbar.addSeparator()
51
50
 
52
51
 
53
52
  class IconAction(ToolBarAction):
@@ -88,12 +87,14 @@ class MaterialIconAction:
88
87
  tooltip: str = None,
89
88
  checkable: bool = False,
90
89
  filled: bool = False,
90
+ color: str | tuple | QColor | dict[Literal["dark", "light"], str] | None = None,
91
91
  ):
92
92
  self.icon_name = icon_name
93
93
  self.tooltip = tooltip
94
94
  self.checkable = checkable
95
95
  self.action = None
96
96
  self.filled = filled
97
+ self.color = color
97
98
 
98
99
  def add_to_toolbar(self, toolbar: QToolBar, target: QWidget):
99
100
  icon = self.get_icon()
@@ -104,7 +105,11 @@ class MaterialIconAction:
104
105
  def get_icon(self):
105
106
 
106
107
  icon = material_icon(
107
- self.icon_name, size=(20, 20), convert_to_pixmap=False, filled=self.filled
108
+ self.icon_name,
109
+ size=(20, 20),
110
+ convert_to_pixmap=False,
111
+ filled=self.filled,
112
+ color=self.color,
108
113
  )
109
114
  return icon
110
115
 
@@ -219,3 +224,4 @@ class ModularToolBar(QToolBar):
219
224
  self.setMovable(False)
220
225
  self.setFloatable(False)
221
226
  self.setContentsMargins(0, 0, 0, 0)
227
+ self.setStyleSheet("QToolBar { background-color: rgba(0, 0, 0, 0); border: none; }")
@@ -1,19 +1,28 @@
1
- from qtpy.QtWidgets import QWidget
1
+ from qtpy.QtWidgets import QApplication, QWidget
2
2
 
3
3
  from bec_widgets.utils.bec_connector import BECConnector, ConnectionConfig
4
+ from bec_widgets.utils.colors import set_theme
4
5
 
5
6
 
6
7
  class BECWidget(BECConnector):
7
8
  """Mixin class for all BEC widgets, to handle cleanup"""
8
9
 
10
+ # The icon name is the name of the icon in the icon theme, typically a name taken
11
+ # from fonts.google.com/icons. Override this in subclasses to set the icon name.
12
+ ICON_NAME = "widgets"
13
+
9
14
  def __init__(self, client=None, config: ConnectionConfig = None, gui_id: str = None):
10
15
  if not isinstance(self, QWidget):
11
16
  raise RuntimeError(f"{repr(self)} is not a subclass of QWidget")
12
17
  super().__init__(client, config, gui_id)
13
18
 
19
+ # Set the theme to auto if it is not set yet
20
+ app = QApplication.instance()
21
+ if not hasattr(app, "theme"):
22
+ set_theme("dark")
23
+
14
24
  def cleanup(self):
15
25
  """Cleanup the widget."""
16
- pass
17
26
 
18
27
  def closeEvent(self, event):
19
28
  self.rpc_register.remove_rpc(self)
@@ -29,6 +29,7 @@ def set_theme(theme: Literal["dark", "light", "auto"]):
29
29
  app = QApplication.instance()
30
30
  bec_qthemes.setup_theme(theme)
31
31
  pg.setConfigOption("background", "w" if app.theme["theme"] == "light" else "k")
32
+ apply_theme(theme)
32
33
 
33
34
  # pylint: disable=protected-access
34
35
  if theme != "auto":
@@ -44,6 +45,9 @@ def set_theme(theme: Literal["dark", "light", "auto"]):
44
45
 
45
46
 
46
47
  def apply_theme(theme: Literal["dark", "light"]):
48
+ """
49
+ Apply the theme to all pyqtgraph widgets. Do not use this function directly. Use set_theme instead.
50
+ """
47
51
  app = QApplication.instance()
48
52
  # go through all pyqtgraph widgets and set background
49
53
  children = itertools.chain.from_iterable(
@@ -105,8 +109,19 @@ class Colors:
105
109
  angles = Colors.golden_ratio(len(cmap_colors))
106
110
  color_selection = np.round(np.interp(angles, (-np.pi, np.pi), (0, len(cmap_colors))))
107
111
  colors = []
108
- for ii in color_selection[:num]:
109
- color = cmap_colors[int(ii)]
112
+ ii = 0
113
+ while len(colors) < num:
114
+ color_index = int(color_selection[ii])
115
+ color = cmap_colors[color_index]
116
+ app = QApplication.instance()
117
+ if hasattr(app, "theme") and app.theme["theme"] == "light":
118
+ background = 255
119
+ else:
120
+ background = 0
121
+ if np.abs(np.mean(color[:3] * 255) - background) < 50:
122
+ ii += 1
123
+ continue
124
+
110
125
  if format.upper() == "HEX":
111
126
  colors.append(QColor.fromRgbF(*color).name())
112
127
  elif format.upper() == "RGB":
@@ -115,6 +130,7 @@ class Colors:
115
130
  colors.append(QColor.fromRgbF(*color))
116
131
  else:
117
132
  raise ValueError("Unsupported format. Please choose 'RGB', 'HEX', or 'QColor'.")
133
+ ii += 1
118
134
  return colors
119
135
 
120
136
  @staticmethod
@@ -2,8 +2,8 @@
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
 
4
4
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
5
- from qtpy.QtGui import QIcon
6
5
 
6
+ from bec_widgets.utils.bec_designer import designer_material_icon
7
7
  {widget_import}
8
8
 
9
9
  DOM_XML = """
@@ -30,7 +30,7 @@ class {plugin_name_pascal}Plugin(QDesignerCustomWidgetInterface): # pragma: no
30
30
  return ""
31
31
 
32
32
  def icon(self):
33
- return QIcon()
33
+ return designer_material_icon({plugin_name_pascal}.ICON_NAME)
34
34
 
35
35
  def includeFile(self):
36
36
  return "{plugin_name_snake}"
@@ -13,6 +13,8 @@ class BECQueue(BECWidget, QWidget):
13
13
  Widget to display the BEC queue.
14
14
  """
15
15
 
16
+ ICON_NAME = "edit_note"
17
+
16
18
  def __init__(
17
19
  self,
18
20
  parent: QWidget | None = None,
@@ -34,7 +34,7 @@ class BECQueuePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
34
  return "BEC Services"
35
35
 
36
36
  def icon(self):
37
- return designer_material_icon("edit_note")
37
+ return designer_material_icon(BECQueue.ICON_NAME)
38
38
 
39
39
  def includeFile(self):
40
40
  return "bec_queue"
@@ -43,6 +43,8 @@ class BECServiceStatusMixin(QObject):
43
43
 
44
44
  services_update = Signal(dict, dict)
45
45
 
46
+ ICON_NAME = "dns"
47
+
46
48
  def __init__(self, parent, client: BECClient):
47
49
  super().__init__(parent)
48
50
  self.client = client
@@ -34,7 +34,7 @@ class BECStatusBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
34
  return "BEC Services"
35
35
 
36
36
  def icon(self):
37
- return designer_material_icon("dns")
37
+ return designer_material_icon(BECStatusBox.ICON_NAME)
38
38
 
39
39
  def includeFile(self):
40
40
  return "bec_status_box"
@@ -11,6 +11,8 @@ class ColorButton(pg.ColorButton):
11
11
  Patches event loop of the ColorDialog, if opened in another QDialog.
12
12
  """
13
13
 
14
+ ICON_NAME = "colors"
15
+
14
16
  def __init__(self, *args, **kwargs):
15
17
  super().__init__(*args, **kwargs)
16
18
 
@@ -31,7 +31,7 @@ class ColorButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
31
31
  return "BEC Buttons"
32
32
 
33
33
  def icon(self):
34
- return designer_material_icon("colors")
34
+ return designer_material_icon(ColorButton.ICON_NAME)
35
35
 
36
36
  def includeFile(self):
37
37
  return "color_button"
@@ -46,6 +46,7 @@ class ColormapSelector(QWidget):
46
46
  """
47
47
 
48
48
  colormap_changed_signal = Signal(str)
49
+ ICON_NAME = "palette"
49
50
 
50
51
  def __init__(self, parent=None, default_colormaps=None):
51
52
  super().__init__(parent=parent)
@@ -34,7 +34,7 @@ class ColormapSelectorPlugin(QDesignerCustomWidgetInterface): # pragma: no cove
34
34
  return "BEC Buttons"
35
35
 
36
36
  def icon(self):
37
- return designer_material_icon("palette")
37
+ return designer_material_icon(ColormapSelector.ICON_NAME)
38
38
 
39
39
  def includeFile(self):
40
40
  return "colormap_selector"
@@ -1,6 +1,6 @@
1
1
  from bec_qthemes import material_icon
2
2
  from qtpy.QtCore import Property, Qt, Slot
3
- from qtpy.QtWidgets import QHBoxLayout, QPushButton, QWidget
3
+ from qtpy.QtWidgets import QHBoxLayout, QPushButton, QToolButton, QWidget
4
4
 
5
5
  from bec_widgets.utils.bec_widget import BECWidget
6
6
  from bec_widgets.utils.colors import set_theme
@@ -9,8 +9,14 @@ from bec_widgets.utils.colors import set_theme
9
9
  class DarkModeButton(BECWidget, QWidget):
10
10
  USER_ACCESS = ["toggle_dark_mode"]
11
11
 
12
+ ICON_NAME = "dark_mode"
13
+
12
14
  def __init__(
13
- self, parent: QWidget | None = None, client=None, gui_id: str | None = None
15
+ self,
16
+ parent: QWidget | None = None,
17
+ client=None,
18
+ gui_id: str | None = None,
19
+ toolbar: bool = False,
14
20
  ) -> None:
15
21
  super().__init__(client=client, gui_id=gui_id)
16
22
  QWidget.__init__(self, parent)
@@ -22,7 +28,10 @@ class DarkModeButton(BECWidget, QWidget):
22
28
  self.layout.setAlignment(Qt.AlignmentFlag.AlignVCenter)
23
29
 
24
30
  icon = material_icon("dark_mode", size=(20, 20), convert_to_pixmap=False)
25
- self.mode_button = QPushButton(icon=icon)
31
+ if toolbar:
32
+ self.mode_button = QToolButton(icon=icon)
33
+ else:
34
+ self.mode_button = QPushButton(icon=icon)
26
35
  self.update_mode_button()
27
36
  self.mode_button.clicked.connect(self.toggle_dark_mode)
28
37
  self.layout.addWidget(self.mode_button)
@@ -30,7 +30,7 @@ class DarkModeButtonPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
30
30
  return "BEC Buttons"
31
31
 
32
32
  def icon(self):
33
- return designer_material_icon("dark_mode")
33
+ return designer_material_icon(DarkModeButton.ICON_NAME)
34
34
 
35
35
  def includeFile(self):
36
36
  return "dark_mode_button"
@@ -15,6 +15,8 @@ from bec_widgets.widgets.device_browser.device_item import DeviceItem
15
15
  class DeviceBrowser(BECWidget, QWidget):
16
16
  device_update: Signal = Signal()
17
17
 
18
+ ICON_NAME = "lists"
19
+
18
20
  def __init__(
19
21
  self,
20
22
  parent: Optional[QWidget] = None,
@@ -30,7 +30,7 @@ class DeviceBrowserPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
30
30
  return "BEC Services"
31
31
 
32
32
  def icon(self):
33
- return designer_material_icon("lists")
33
+ return designer_material_icon(DeviceBrowser.ICON_NAME)
34
34
 
35
35
  def includeFile(self):
36
36
  return "device_browser"
@@ -34,7 +34,7 @@ class DeviceComboBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
34
  return "Device Control"
35
35
 
36
36
  def icon(self):
37
- return designer_material_icon("list_alt")
37
+ return designer_material_icon(DeviceComboBox.ICON_NAME)
38
38
 
39
39
  def includeFile(self):
40
40
  return "device_combobox"
@@ -22,6 +22,8 @@ class DeviceComboBox(DeviceInputBase, QComboBox):
22
22
  arg_name: Argument name, can be used for the other widgets which has to call some other function in bec using correct argument names.
23
23
  """
24
24
 
25
+ ICON_NAME = "list_alt"
26
+
25
27
  def __init__(
26
28
  self,
27
29
  parent=None,
@@ -24,6 +24,8 @@ class DeviceLineEdit(DeviceInputBase, QLineEdit):
24
24
  arg_name: Argument name, can be used for the other widgets which has to call some other function in bec using correct argument names.
25
25
  """
26
26
 
27
+ ICON_NAME = "edit_note"
28
+
27
29
  def __init__(
28
30
  self,
29
31
  parent=None,
@@ -34,7 +34,7 @@ class DeviceLineEditPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
34
34
  return "Device Control"
35
35
 
36
36
  def icon(self):
37
- return designer_material_icon("edit_note")
37
+ return designer_material_icon(DeviceLineEdit.ICON_NAME)
38
38
 
39
39
  def includeFile(self):
40
40
  return "device_line_edit"