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.
- .gitlab-ci.yml +0 -1
- CHANGELOG.md +70 -82
- PKG-INFO +2 -2
- bec_widgets/cli/client.py +3 -3
- bec_widgets/qt_utils/toolbar.py +11 -5
- bec_widgets/utils/bec_widget.py +11 -2
- bec_widgets/utils/colors.py +18 -2
- bec_widgets/utils/crosshair.py +4 -0
- bec_widgets/utils/plugin_templates/plugin.template +2 -2
- bec_widgets/widgets/bec_queue/bec_queue.py +2 -0
- bec_widgets/widgets/bec_queue/bec_queue_plugin.py +1 -1
- bec_widgets/widgets/bec_status_box/bec_status_box.py +2 -0
- bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +1 -1
- bec_widgets/widgets/color_button/color_button.py +2 -0
- bec_widgets/widgets/color_button/color_button_plugin.py +1 -1
- bec_widgets/widgets/colormap_selector/colormap_selector.py +1 -0
- bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py +1 -1
- bec_widgets/widgets/dark_mode_button/dark_mode_button.py +12 -3
- bec_widgets/widgets/dark_mode_button/dark_mode_button_plugin.py +1 -1
- bec_widgets/widgets/device_browser/device_browser.py +2 -0
- bec_widgets/widgets/device_browser/device_browser_plugin.py +1 -1
- bec_widgets/widgets/device_combobox/device_combo_box_plugin.py +1 -1
- bec_widgets/widgets/device_combobox/device_combobox.py +2 -0
- bec_widgets/widgets/device_line_edit/device_line_edit.py +2 -0
- bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +1 -1
- bec_widgets/widgets/dock/dock.py +1 -0
- bec_widgets/widgets/dock/dock_area.py +30 -10
- bec_widgets/widgets/dock/dock_area_plugin.py +1 -1
- bec_widgets/widgets/figure/figure.py +1 -1
- bec_widgets/widgets/figure/plots/plot_base.py +6 -0
- bec_widgets/widgets/figure/plots/waveform/waveform.py +12 -7
- bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +3 -3
- bec_widgets/widgets/image/bec_image_widget_plugin.py +1 -1
- bec_widgets/widgets/image/image_widget.py +1 -0
- bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py +1 -1
- bec_widgets/widgets/motor_map/motor_map_widget.py +1 -0
- bec_widgets/widgets/position_indicator/position_indicator.py +2 -0
- bec_widgets/widgets/position_indicator/position_indicator_plugin.py +1 -1
- bec_widgets/widgets/positioner_box/positioner_box.py +1 -0
- bec_widgets/widgets/positioner_box/positioner_box_plugin.py +1 -1
- bec_widgets/widgets/positioner_box/positioner_control_line.py +2 -0
- bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +1 -1
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +1 -0
- bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +1 -1
- bec_widgets/widgets/scan_control/scan_control.py +2 -0
- bec_widgets/widgets/scan_control/scan_control_plugin.py +1 -4
- bec_widgets/widgets/spinner/spinner.py +2 -0
- bec_widgets/widgets/spinner/spinner_widget_plugin.py +1 -1
- bec_widgets/widgets/stop_button/stop_button.py +2 -0
- bec_widgets/widgets/stop_button/stop_button_plugin.py +1 -1
- bec_widgets/widgets/text_box/text_box.py +1 -0
- bec_widgets/widgets/text_box/text_box_plugin.py +1 -1
- bec_widgets/widgets/toggle/toggle.py +1 -0
- bec_widgets/widgets/toggle/toggle_switch_plugin.py +1 -1
- bec_widgets/widgets/vscode/vs_code_editor_plugin.py +1 -1
- bec_widgets/widgets/vscode/vscode.py +1 -0
- bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +1 -1
- bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +14 -13
- bec_widgets/widgets/waveform/waveform_widget.py +39 -2
- bec_widgets/widgets/website/website.py +42 -10
- bec_widgets/widgets/website/website_widget_plugin.py +1 -1
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/METADATA +2 -2
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/RECORD +85 -122
- docs/assets/widget_screenshots/buttons.png +0 -0
- docs/developer/widget_development/bec_dispatcher.md +1 -1
- docs/developer/widget_development/widget_base_class.md +171 -0
- docs/developer/widget_development/widget_development.md +3 -2
- docs/index.md +2 -2
- docs/user/widgets/buttons/buttons.md +32 -5
- docs/user/widgets/dock_area/bec_dock_area.md +4 -2
- docs/user/widgets/position_indicator/position_indicator.md +1 -8
- docs/user/widgets/spinner/spinner.md +0 -7
- docs/user/widgets/waveform/waveform_widget.md +3 -3
- docs/user/widgets/widgets.md +1 -1
- pyproject.toml +2 -2
- tests/unit_tests/test_configs/config_device.yaml +1 -1
- tests/unit_tests/test_configs/config_device_no_entry.yaml +1 -1
- tests/unit_tests/test_configs/config_scan.yaml +1 -1
- tests/unit_tests/test_crosshair.py +2 -2
- tests/unit_tests/test_waveform1d.py +14 -14
- tests/unit_tests/test_waveform_widget.py +2 -2
- tests/unit_tests/test_website_widget.py +2 -2
- bec_widgets/assets/toolbar_icons/add.svg +0 -3
- bec_widgets/assets/toolbar_icons/attach_all.svg +0 -3
- bec_widgets/assets/toolbar_icons/auto_range.svg +0 -3
- bec_widgets/assets/toolbar_icons/compare.svg +0 -3
- bec_widgets/assets/toolbar_icons/connection.svg +0 -4
- bec_widgets/assets/toolbar_icons/device_line_edit.svg +0 -3
- bec_widgets/assets/toolbar_icons/drag_pan_mode.svg +0 -3
- bec_widgets/assets/toolbar_icons/export.svg +0 -9
- bec_widgets/assets/toolbar_icons/fft.svg +0 -11
- bec_widgets/assets/toolbar_icons/fitting_parameters.svg +0 -3
- bec_widgets/assets/toolbar_icons/history.svg +0 -4
- bec_widgets/assets/toolbar_icons/image.svg +0 -3
- bec_widgets/assets/toolbar_icons/image_autorange.svg +0 -3
- bec_widgets/assets/toolbar_icons/import.svg +0 -9
- bec_widgets/assets/toolbar_icons/line_axis.svg +0 -3
- bec_widgets/assets/toolbar_icons/line_curve.svg +0 -3
- bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +0 -3
- bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
- bec_widgets/assets/toolbar_icons/motor_map.svg +0 -3
- bec_widgets/assets/toolbar_icons/photo_library.svg +0 -3
- bec_widgets/assets/toolbar_icons/positioner_box.svg +0 -3
- bec_widgets/assets/toolbar_icons/progress.svg +0 -3
- bec_widgets/assets/toolbar_icons/queue.svg +0 -3
- bec_widgets/assets/toolbar_icons/rectangle_mode.svg +0 -3
- bec_widgets/assets/toolbar_icons/remove.svg +0 -5
- bec_widgets/assets/toolbar_icons/reset_settings.svg +0 -3
- bec_widgets/assets/toolbar_icons/restore_state.svg +0 -3
- bec_widgets/assets/toolbar_icons/ring_progress.svg +0 -3
- bec_widgets/assets/toolbar_icons/rotate_left.svg +0 -3
- bec_widgets/assets/toolbar_icons/rotate_right.svg +0 -3
- bec_widgets/assets/toolbar_icons/save.svg +0 -3
- bec_widgets/assets/toolbar_icons/save_state.svg +0 -3
- bec_widgets/assets/toolbar_icons/scan_control.svg +0 -3
- bec_widgets/assets/toolbar_icons/settings.svg +0 -4
- bec_widgets/assets/toolbar_icons/status.svg +0 -3
- bec_widgets/assets/toolbar_icons/terminal.svg +0 -3
- bec_widgets/assets/toolbar_icons/transform.svg +0 -3
- bec_widgets/assets/toolbar_icons/waveform.svg +0 -3
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/WHEEL +0 -0
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.99.0.dist-info → bec_widgets-0.99.8.dist-info}/licenses/LICENSE +0 -0
.gitlab-ci.yml
CHANGED
CHANGELOG.md
CHANGED
@@ -1,173 +1,161 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
## v0.99.
|
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(
|
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(
|
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
|
-
|
13
|
+
## v0.99.7 (2024-08-28)
|
22
14
|
|
23
|
-
|
24
|
-
|
25
|
-
## v0.98.0 (2024-08-25)
|
15
|
+
### Fix
|
26
16
|
|
27
|
-
|
17
|
+
* fix(toolbar): material icons can accept color as kwarg ([`ffc871e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ffc871ebbd3b68abc3e151bb8f5849e6c50e775e))
|
28
18
|
|
29
|
-
|
19
|
+
## v0.99.6 (2024-08-28)
|
30
20
|
|
31
|
-
###
|
21
|
+
### Documentation
|
32
22
|
|
33
|
-
*
|
23
|
+
* docs: various bugs fixed ([`c31e9a3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c31e9a3aff3ee8e984674dee0965ee7f1b6e2b8f))
|
34
24
|
|
35
|
-
|
25
|
+
### Fix
|
36
26
|
|
37
|
-
* fix(
|
27
|
+
* fix(toolbar): use of native qt separators ([`09c6c93`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/09c6c93c397ce4a21c293f6c79106c74b2db65ca))
|
38
28
|
|
39
|
-
|
29
|
+
## v0.99.5 (2024-08-28)
|
40
30
|
|
41
|
-
|
31
|
+
### Documentation
|
42
32
|
|
43
|
-
*
|
33
|
+
* docs(index): index page is centered ([`02239de`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/02239de0a36fcd6cbf97990b0dec1ddf7ecf6ba6))
|
44
34
|
|
45
|
-
|
35
|
+
### Fix
|
46
36
|
|
47
|
-
|
37
|
+
* fix(dock_area): dark button added ([`e6f204b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e6f204b6aa295747a68769f43af2e549149b401a))
|
48
38
|
|
49
|
-
|
39
|
+
## v0.99.4 (2024-08-28)
|
50
40
|
|
51
|
-
|
41
|
+
### Documentation
|
52
42
|
|
53
|
-
|
43
|
+
* docs(buttons): added missing buttons docs ([`4e5520a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4e5520aee2115d2fc0cebb3865433478a5ec8253))
|
54
44
|
|
55
|
-
*
|
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(
|
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
|
-
|
51
|
+
### Refactor
|
62
52
|
|
63
|
-
|
53
|
+
* refactor(buttons): changed grid and thumbnail fig in gallery ([`4591ba8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4591ba8f73e22aba7258cad93c073f1387cb74a0))
|
64
54
|
|
65
|
-
*
|
55
|
+
* refactor(icons): removed toolbar icons from assets ([`f335763`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f335763280adb1d83ba31f073ce206e4cb5d15ef))
|
66
56
|
|
67
|
-
|
57
|
+
* refactor(icons): moved widget icons to class attribute ICON_NAME ([`e890091`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e890091d862e42317c7a54fc414ba37c85f268b0))
|
68
58
|
|
69
|
-
|
59
|
+
## v0.99.3 (2024-08-27)
|
70
60
|
|
71
|
-
|
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(
|
67
|
+
* fix(cmaps): unified all defaults to magma cmap ([`1ca9499`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1ca9499edd334c19fe1e7aac71d3940a80a1ec95))
|
76
68
|
|
77
|
-
* fix(
|
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.
|
71
|
+
## v0.99.2 (2024-08-27)
|
80
72
|
|
81
73
|
### Ci
|
82
74
|
|
83
|
-
* ci:
|
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(
|
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
|
-
|
83
|
+
## v0.99.1 (2024-08-27)
|
90
84
|
|
91
|
-
|
85
|
+
### Fix
|
92
86
|
|
93
|
-
* fix(crosshair):
|
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.
|
89
|
+
## v0.99.0 (2024-08-25)
|
96
90
|
|
97
91
|
### Documentation
|
98
92
|
|
99
|
-
* docs(
|
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(
|
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(
|
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:
|
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
|
-
|
107
|
+
### Test
|
120
108
|
|
121
|
-
|
109
|
+
* test(dark_mode_button): added tests for dark mode button ([`df35aab`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df35aabff30c5d00b1c441132bd370446653741e))
|
122
110
|
|
123
|
-
|
111
|
+
## v0.98.0 (2024-08-25)
|
124
112
|
|
125
|
-
|
113
|
+
### Feature
|
126
114
|
|
127
|
-
*
|
115
|
+
* feat(themes): added set_theme method ([`2b4449a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2b4449afebdda0a97f95712a1353cf40ec55c283))
|
128
116
|
|
129
|
-
|
117
|
+
### Fix
|
130
118
|
|
131
|
-
*
|
119
|
+
* fix(toolbar): removed hardcoded color values ([`afdf4e8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/afdf4e8782a22566932180224fa1c924d24c810f))
|
132
120
|
|
133
|
-
|
121
|
+
* fix: transitioning to material icons ([`2a82032`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2a82032644a84e38df04e2035a6aa63f4a046360))
|
134
122
|
|
135
|
-
*
|
123
|
+
* fix(dock_area): transitioned to MaterialIconAction ([`88a2f66`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/88a2f667588e9aeb34ae556fa327898824052bc3))
|
136
124
|
|
137
|
-
*
|
125
|
+
* fix: fix color palette if qtheme was not called ([`3f3b207`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3f3b207295ebd406ebaeecee465c774965161b8b))
|
138
126
|
|
139
|
-
|
127
|
+
* fix(figure): removed theme from figure init ([`e42b84c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e42b84c63650297d67feffccc02a2c2ba111ca79))
|
140
128
|
|
141
|
-
* fix
|
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(
|
135
|
+
* refactor(waveform): use set theme for demo ([`44cfda1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/44cfda1c07306669c9a4e09706d95e6b91dee370))
|
146
136
|
|
147
|
-
|
137
|
+
## v0.97.0 (2024-08-23)
|
148
138
|
|
149
|
-
|
139
|
+
### Feature
|
150
140
|
|
151
|
-
|
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:
|
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
|
-
|
147
|
+
## v0.96.3 (2024-08-23)
|
160
148
|
|
161
|
-
|
149
|
+
### Documentation
|
162
150
|
|
163
|
-
|
151
|
+
* docs(dispatcher): docs added ([`dd7c71b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd7c71bb1e0b7ef5398b1e1a05fc1147c772420a))
|
164
152
|
|
165
|
-
###
|
153
|
+
### Fix
|
166
154
|
|
167
|
-
*
|
155
|
+
* fix: minor fixes for type annotations ([`8c2e7c8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8c2e7c82592ace50e4e1f47e392a0ddc988f57ae))
|
168
156
|
|
169
|
-
|
157
|
+
## v0.96.2 (2024-08-22)
|
170
158
|
|
171
159
|
### Fix
|
172
160
|
|
173
|
-
* fix(
|
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.
|
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
|
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" = "
|
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" = "
|
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" = "
|
2045
|
+
color_map_z: "str | None" = "magma",
|
2046
2046
|
label: "str | None" = None,
|
2047
2047
|
validate: "bool" = True,
|
2048
2048
|
dap: "str | None" = None,
|
bec_widgets/qt_utils/toolbar.py
CHANGED
@@ -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
|
-
|
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,
|
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; }")
|
bec_widgets/utils/bec_widget.py
CHANGED
@@ -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)
|
bec_widgets/utils/colors.py
CHANGED
@@ -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
|
-
|
109
|
-
|
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
|
bec_widgets/utils/crosshair.py
CHANGED
@@ -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
|
33
|
+
return designer_material_icon({plugin_name_pascal}.ICON_NAME)
|
34
34
|
|
35
35
|
def includeFile(self):
|
36
36
|
return "{plugin_name_snake}"
|
@@ -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(
|
37
|
+
return designer_material_icon(BECQueue.ICON_NAME)
|
38
38
|
|
39
39
|
def includeFile(self):
|
40
40
|
return "bec_queue"
|
@@ -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(
|
37
|
+
return designer_material_icon(BECStatusBox.ICON_NAME)
|
38
38
|
|
39
39
|
def includeFile(self):
|
40
40
|
return "bec_status_box"
|
@@ -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(
|
34
|
+
return designer_material_icon(ColorButton.ICON_NAME)
|
35
35
|
|
36
36
|
def includeFile(self):
|
37
37
|
return "color_button"
|
@@ -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(
|
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,
|
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
|
-
|
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(
|
33
|
+
return designer_material_icon(DarkModeButton.ICON_NAME)
|
34
34
|
|
35
35
|
def includeFile(self):
|
36
36
|
return "dark_mode_button"
|
@@ -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(
|
33
|
+
return designer_material_icon(DeviceBrowser.ICON_NAME)
|
34
34
|
|
35
35
|
def includeFile(self):
|
36
36
|
return "device_browser"
|