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