bec-widgets 0.99.1__py3-none-any.whl → 0.99.8__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 (121) hide show
  1. .gitlab-ci.yml +0 -1
  2. CHANGELOG.md +77 -71
  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.8.dist-info}/METADATA +2 -2
  61. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.8.dist-info}/RECORD +83 -120
  62. docs/assets/widget_screenshots/buttons.png +0 -0
  63. docs/developer/widget_development/bec_dispatcher.md +1 -1
  64. docs/developer/widget_development/widget_base_class.md +171 -0
  65. docs/developer/widget_development/widget_development.md +3 -2
  66. docs/index.md +2 -2
  67. docs/user/widgets/buttons/buttons.md +32 -5
  68. docs/user/widgets/dock_area/bec_dock_area.md +4 -2
  69. docs/user/widgets/position_indicator/position_indicator.md +1 -8
  70. docs/user/widgets/spinner/spinner.md +0 -7
  71. docs/user/widgets/waveform/waveform_widget.md +3 -3
  72. docs/user/widgets/widgets.md +1 -1
  73. pyproject.toml +2 -2
  74. tests/unit_tests/test_configs/config_device.yaml +1 -1
  75. tests/unit_tests/test_configs/config_device_no_entry.yaml +1 -1
  76. tests/unit_tests/test_configs/config_scan.yaml +1 -1
  77. tests/unit_tests/test_crosshair.py +2 -2
  78. tests/unit_tests/test_waveform1d.py +14 -14
  79. tests/unit_tests/test_waveform_widget.py +2 -2
  80. tests/unit_tests/test_website_widget.py +2 -2
  81. bec_widgets/assets/toolbar_icons/add.svg +0 -3
  82. bec_widgets/assets/toolbar_icons/attach_all.svg +0 -3
  83. bec_widgets/assets/toolbar_icons/auto_range.svg +0 -3
  84. bec_widgets/assets/toolbar_icons/compare.svg +0 -3
  85. bec_widgets/assets/toolbar_icons/connection.svg +0 -4
  86. bec_widgets/assets/toolbar_icons/device_line_edit.svg +0 -3
  87. bec_widgets/assets/toolbar_icons/drag_pan_mode.svg +0 -3
  88. bec_widgets/assets/toolbar_icons/export.svg +0 -9
  89. bec_widgets/assets/toolbar_icons/fft.svg +0 -11
  90. bec_widgets/assets/toolbar_icons/fitting_parameters.svg +0 -3
  91. bec_widgets/assets/toolbar_icons/history.svg +0 -4
  92. bec_widgets/assets/toolbar_icons/image.svg +0 -3
  93. bec_widgets/assets/toolbar_icons/image_autorange.svg +0 -3
  94. bec_widgets/assets/toolbar_icons/import.svg +0 -9
  95. bec_widgets/assets/toolbar_icons/line_axis.svg +0 -3
  96. bec_widgets/assets/toolbar_icons/line_curve.svg +0 -3
  97. bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +0 -3
  98. bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
  99. bec_widgets/assets/toolbar_icons/motor_map.svg +0 -3
  100. bec_widgets/assets/toolbar_icons/photo_library.svg +0 -3
  101. bec_widgets/assets/toolbar_icons/positioner_box.svg +0 -3
  102. bec_widgets/assets/toolbar_icons/progress.svg +0 -3
  103. bec_widgets/assets/toolbar_icons/queue.svg +0 -3
  104. bec_widgets/assets/toolbar_icons/rectangle_mode.svg +0 -3
  105. bec_widgets/assets/toolbar_icons/remove.svg +0 -5
  106. bec_widgets/assets/toolbar_icons/reset_settings.svg +0 -3
  107. bec_widgets/assets/toolbar_icons/restore_state.svg +0 -3
  108. bec_widgets/assets/toolbar_icons/ring_progress.svg +0 -3
  109. bec_widgets/assets/toolbar_icons/rotate_left.svg +0 -3
  110. bec_widgets/assets/toolbar_icons/rotate_right.svg +0 -3
  111. bec_widgets/assets/toolbar_icons/save.svg +0 -3
  112. bec_widgets/assets/toolbar_icons/save_state.svg +0 -3
  113. bec_widgets/assets/toolbar_icons/scan_control.svg +0 -3
  114. bec_widgets/assets/toolbar_icons/settings.svg +0 -4
  115. bec_widgets/assets/toolbar_icons/status.svg +0 -3
  116. bec_widgets/assets/toolbar_icons/terminal.svg +0 -3
  117. bec_widgets/assets/toolbar_icons/transform.svg +0 -3
  118. bec_widgets/assets/toolbar_icons/waveform.svg +0 -3
  119. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.8.dist-info}/WHEEL +0 -0
  120. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.8.dist-info}/entry_points.txt +0 -0
  121. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.8.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.8 (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))
8
-
9
- ## v0.99.0 (2024-08-25)
10
-
11
- ### Documentation
7
+ * fix(website): fixed designer integration for website widget ([`5f37e86`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5f37e862c95ac7173b6918ad39bcaef938dad698))
12
8
 
13
- * docs(darkmodebutton): added dark mode button docs ([`406c263`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/406c263746f0e809c1a4d98356c48f40428c23d7))
9
+ ### Refactor
14
10
 
15
- ### Feature
11
+ * refactor(website): changed inheritance of website widget to simple qwidget; closes #325 ([`9925bbd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9925bbdb48b55eacbbce9fd6a1555a21b84221f9))
16
12
 
17
- * feat(darkmodebutton): added button to toggle between dark and light mode ([`cc8c166`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cc8c166b5c1d37e0f64c83801b2347a54a6550b6))
13
+ ## v0.99.7 (2024-08-28)
18
14
 
19
15
  ### Fix
20
16
 
21
- * fix(toggle): emit state change ([`c4f3308`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c4f3308dc0c3e4b2064760ccd7372d71b3e49f96))
17
+ * fix(toolbar): material icons can accept color as kwarg ([`ffc871e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ffc871ebbd3b68abc3e151bb8f5849e6c50e775e))
22
18
 
23
- ### Refactor
19
+ ## v0.99.6 (2024-08-28)
24
20
 
25
- * refactor(darkmodebutton): renamed set_dark_mode_enabled to toggle_dark_mode ([`c70724a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c70724a456900bcb06b040407a2c5d497e49ce77))
21
+ ### Documentation
26
22
 
27
- ### Test
23
+ * docs: various bugs fixed ([`c31e9a3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c31e9a3aff3ee8e984674dee0965ee7f1b6e2b8f))
28
24
 
29
- * test(dark_mode_button): added tests for dark mode button ([`df35aab`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df35aabff30c5d00b1c441132bd370446653741e))
25
+ ### Fix
30
26
 
31
- ## v0.98.0 (2024-08-25)
27
+ * fix(toolbar): use of native qt separators ([`09c6c93`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/09c6c93c397ce4a21c293f6c79106c74b2db65ca))
32
28
 
33
- ### Feature
29
+ ## v0.99.5 (2024-08-28)
34
30
 
35
- * feat(themes): added set_theme method ([`2b4449a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2b4449afebdda0a97f95712a1353cf40ec55c283))
31
+ ### Documentation
32
+
33
+ * docs(index): index page is centered ([`02239de`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/02239de0a36fcd6cbf97990b0dec1ddf7ecf6ba6))
36
34
 
37
35
  ### Fix
38
36
 
39
- * fix(toolbar): removed hardcoded color values ([`afdf4e8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/afdf4e8782a22566932180224fa1c924d24c810f))
37
+ * fix(dock_area): dark button added ([`e6f204b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e6f204b6aa295747a68769f43af2e549149b401a))
40
38
 
41
- * fix: transitioning to material icons ([`2a82032`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2a82032644a84e38df04e2035a6aa63f4a046360))
39
+ ## v0.99.4 (2024-08-28)
42
40
 
43
- * fix(dock_area): transitioned to MaterialIconAction ([`88a2f66`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/88a2f667588e9aeb34ae556fa327898824052bc3))
41
+ ### Documentation
44
42
 
45
- * fix: fix color palette if qtheme was not called ([`3f3b207`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3f3b207295ebd406ebaeecee465c774965161b8b))
43
+ * docs(buttons): added missing buttons docs ([`4e5520a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4e5520aee2115d2fc0cebb3865433478a5ec8253))
46
44
 
47
- * fix(figure): removed theme from figure init ([`e42b84c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e42b84c63650297d67feffccc02a2c2ba111ca79))
45
+ * docs(developer): tutorial for BECWidget base class ([`ac2cb51`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ac2cb5197deef4d51e26ee5beb070eba3ffc210d))
48
46
 
49
- * fix: use globally set theme instead of the internal bec widgets theme ([`77c5aa7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/77c5aa741cf1f5b969a42aa878aa2965176dbf41))
47
+ ### Fix
50
48
 
51
- * fix(waveform): fixed icon appearance ([`36ad464`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/36ad4641594b67c9b789515c28f7db78a12757ee))
49
+ * fix(theme): apply theme to all pyqtgraph widgets on manual updates ([`c550186`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c5501860e8e07a53f4bce144d44ed39eda6290ef))
52
50
 
53
51
  ### Refactor
54
52
 
55
- * refactor(waveform): use set theme for demo ([`44cfda1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44cfda1c07306669c9a4e09706d95e6b91dee370))
53
+ * refactor(buttons): changed grid and thumbnail fig in gallery ([`4591ba8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4591ba8f73e22aba7258cad93c073f1387cb74a0))
56
54
 
57
- ## v0.97.0 (2024-08-23)
55
+ * refactor(icons): removed toolbar icons from assets ([`f335763`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f335763280adb1d83ba31f073ce206e4cb5d15ef))
58
56
 
59
- ### Feature
57
+ * refactor(icons): moved widget icons to class attribute ICON_NAME ([`e890091`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e890091d862e42317c7a54fc414ba37c85f268b0))
60
58
 
61
- * feat(designer): added designer icon factory ([`82a55dd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/82a55ddf3eafb589cb63408db1c0e7e5c9d629da))
59
+ ## v0.99.3 (2024-08-27)
60
+
61
+ ### Build
62
+
63
+ * build: updated min version of bec qthemes ([`d482434`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d48243483ef8228cc5eb85e40a6b8f5da3b45520))
62
64
 
63
65
  ### Fix
64
66
 
65
- * fix(toolbar icon): fixed material icon toolbar for theme changes ([`3ecbd60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3ecbd60627994417c9175364e5909710dbcdceb2))
67
+ * fix(cmaps): unified all defaults to magma cmap ([`1ca9499`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1ca9499edd334c19fe1e7aac71d3940a80a1ec95))
66
68
 
67
- ## v0.96.3 (2024-08-23)
69
+ * 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))
68
70
 
69
- ### Documentation
71
+ ## v0.99.2 (2024-08-27)
70
72
 
71
- * docs(dispatcher): docs added ([`dd7c71b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd7c71bb1e0b7ef5398b1e1a05fc1147c772420a))
73
+ ### Ci
74
+
75
+ * ci: additional tests are not allowed to fail ([`bb385f0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/bb385f07ca18904461a541b5cadde05398c84438))
72
76
 
73
77
  ### Fix
74
78
 
75
- * fix: minor fixes for type annotations ([`8c2e7c8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8c2e7c82592ace50e4e1f47e392a0ddc988f57ae))
79
+ * fix(widgets): fixed default theme for widgets
76
80
 
77
- ## v0.96.2 (2024-08-22)
81
+ 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
+
83
+ ## v0.99.1 (2024-08-27)
78
84
 
79
85
  ### Fix
80
86
 
81
- * fix(waveform): validation of custom curves removed ([`af28574`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/af28574bd58457a05f1269f121db01ad627b5769))
87
+ * fix(crosshair): emit all crosshair events, not just line coordinates ([`2265458`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2265458dcc57970db18c62619f5877d542d72e81))
88
+
89
+ ## v0.99.0 (2024-08-25)
82
90
 
83
- * fix(waveform): skip validation for curves that are not BECCurve instances ([`617db36`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/617db36ed4932c8a0633724079b695bc67d5c77b))
91
+ ### Documentation
84
92
 
85
- ## v0.96.1 (2024-08-22)
93
+ * docs(darkmodebutton): added dark mode button docs ([`406c263`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/406c263746f0e809c1a4d98356c48f40428c23d7))
86
94
 
87
- ### Ci
95
+ ### Feature
88
96
 
89
- * ci: fail pytest after 2 failed tests ([`f0203d9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f0203d9bf60c4975ba5ab93a057d9091762454d5))
97
+ * feat(darkmodebutton): added button to toggle between dark and light mode ([`cc8c166`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/cc8c166b5c1d37e0f64c83801b2347a54a6550b6))
90
98
 
91
99
  ### Fix
92
100
 
93
- * fix(crosshair): update markers if necessary ([`4473805`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44738057a36f5de2bbb55affdd309f92286d4a0f))
94
-
95
- * fix(waveform_widget): fixed icon appearance ([`f98a9f9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f98a9f9771b93226d47830aa52f45739624f51b4))
101
+ * fix(toggle): emit state change ([`c4f3308`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c4f3308dc0c3e4b2064760ccd7372d71b3e49f96))
96
102
 
97
- * fix: bubble-up signals ([`2fe72c9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2fe72c9ccb71bcb196a1b78197b73acf9aa3f506))
103
+ ### Refactor
98
104
 
99
- * fix(crosshair): fixed crosshair for image and waveforms ([`37835cb`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/37835cbf76ca3ba1081f514ee7793244ac500e7f))
105
+ * refactor(darkmodebutton): renamed set_dark_mode_enabled to toggle_dark_mode ([`c70724a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c70724a456900bcb06b040407a2c5d497e49ce77))
100
106
 
101
- ## v0.96.0 (2024-08-22)
107
+ ### Test
102
108
 
103
- ### Documentation
109
+ * test(dark_mode_button): added tests for dark mode button ([`df35aab`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df35aabff30c5d00b1c441132bd370446653741e))
104
110
 
105
- * docs(scan_control): added designer options ([`9d7718c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9d7718c3d9badf14150174410b9958a3134a1e23))
111
+ ## v0.98.0 (2024-08-25)
106
112
 
107
113
  ### Feature
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
+ * feat(themes): added set_theme method ([`2b4449a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2b4449afebdda0a97f95712a1353cf40ec55c283))
116
+
117
+ ### Fix
110
118
 
111
- ## v0.95.1 (2024-08-22)
119
+ * fix(toolbar): removed hardcoded color values ([`afdf4e8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/afdf4e8782a22566932180224fa1c924d24c810f))
112
120
 
113
- ### Documentation
121
+ * fix: transitioning to material icons ([`2a82032`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2a82032644a84e38df04e2035a6aa63f4a046360))
114
122
 
115
- * docs: links section added ([`2bf5c70`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2bf5c7096e7d822713e1b50bde89f072e6356e17))
123
+ * fix(dock_area): transitioned to MaterialIconAction ([`88a2f66`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/88a2f667588e9aeb34ae556fa327898824052bc3))
116
124
 
117
- ### Fix
125
+ * fix: fix color palette if qtheme was not called ([`3f3b207`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3f3b207295ebd406ebaeecee465c774965161b8b))
118
126
 
119
- * fix(docs): changed link to scan gui config in main docs ([`640464a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/640464a6543b2111bdb58d0174f2ce86c5836cbe))
127
+ * fix(figure): removed theme from figure init ([`e42b84c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e42b84c63650297d67feffccc02a2c2ba111ca79))
120
128
 
121
- ### Refactor
129
+ * fix: use globally set theme instead of the internal bec widgets theme ([`77c5aa7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/77c5aa741cf1f5b969a42aa878aa2965176dbf41))
122
130
 
123
- * refactor: removed designer pngs ([`84abe46`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/84abe460502d838aac41bb8ff63d93c9fcec9214))
131
+ * fix(waveform): fixed icon appearance ([`36ad464`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/36ad4641594b67c9b789515c28f7db78a12757ee))
124
132
 
125
- * refactor: moved to dynamically loaded material design icons ([`1d2afaa`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1d2afaa09e64b7f714d72796e87e2cb49b2a75a7))
133
+ ### Refactor
126
134
 
127
- ## v0.95.0 (2024-08-21)
135
+ * refactor(waveform): use set theme for demo ([`44cfda1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44cfda1c07306669c9a4e09706d95e6b91dee370))
128
136
 
129
- ### Documentation
137
+ ## v0.97.0 (2024-08-23)
130
138
 
131
- * docs(device_browser): added user docs ([`2c31cc9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2c31cc90ae751f14a653cbbdd6c353d6359aaafe))
139
+ ### Feature
132
140
 
133
- * docs(user): widget gallery with documentation added ([`7357f3d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7357f3d2a189f9f04954a027f39ce07c394d57ec))
141
+ * feat(designer): added designer icon factory ([`82a55dd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/82a55ddf3eafb589cb63408db1c0e7e5c9d629da))
134
142
 
135
- * docs: added sphinx-inline-tabs as sphinx dependency ([`e9ecd26`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e9ecd268c602ea9572df0e8d508e49ee62d0c170))
143
+ ### Fix
136
144
 
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))
145
+ * fix(toolbar icon): fixed material icon toolbar for theme changes ([`3ecbd60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3ecbd60627994417c9175364e5909710dbcdceb2))
138
146
 
139
- ### Feature
147
+ ## v0.96.3 (2024-08-23)
140
148
 
141
- * feat(cli): added device_browser to cli ([`196504b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/196504b533367a899c19b88af4ccd5b39dc46aac))
149
+ ### Documentation
142
150
 
143
- * feat(widgets): added device_browser widget ([`73f5a2f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/73f5a2f085b289ac18fa8a918b6ad7cfed595fb4))
151
+ * docs(dispatcher): docs added ([`dd7c71b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd7c71bb1e0b7ef5398b1e1a05fc1147c772420a))
144
152
 
145
153
  ### Fix
146
154
 
147
- * fix(device_browser): fixed plugin assignment for designer ([`6500393`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/650039303aae9bbec62c676285938416fff146ce))
148
-
149
- ### Refactor
155
+ * fix: minor fixes for type annotations ([`8c2e7c8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8c2e7c82592ace50e4e1f47e392a0ddc988f57ae))
150
156
 
151
- * refactor(docs): review response ([`4790afd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4790afde3d61fc9beb073c2775c339d4f80779e3))
157
+ ## v0.96.2 (2024-08-22)
152
158
 
153
- ### Test
159
+ ### Fix
154
160
 
155
- * test: added test for device browser ([`e870e5b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e870e5ba083c61df581c9c0305adabe72967f997))
161
+ * fix(waveform): validation of custom curves removed ([`af28574`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/af28574bd58457a05f1269f121db01ad627b5769))
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.8
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"