bec-widgets 2.10.2__py3-none-any.whl → 2.10.3__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.
CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v2.10.3 (2025-06-04)
5
+
6
+ ### Bug Fixes
7
+
8
+ - **color_button_native**: Popup logic to choose color moved to ColorButtonNative
9
+ ([`2d0ed94`](https://github.com/bec-project/bec_widgets/commit/2d0ed94f3feb38dfc9645f2c3b9d6a06b92637bb))
10
+
11
+
4
12
  ## v2.10.2 (2025-06-03)
5
13
 
6
14
  ### Bug Fixes
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bec_widgets
3
- Version: 2.10.2
3
+ Version: 2.10.3
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
@@ -22,6 +22,7 @@ from qtpy.QtWidgets import (
22
22
  QWidget,
23
23
  )
24
24
 
25
+ from bec_widgets import SafeSlot
25
26
  from bec_widgets.utils import ConnectionConfig, EntryValidator
26
27
  from bec_widgets.utils.bec_widget import BECWidget
27
28
  from bec_widgets.utils.colors import Colors
@@ -154,7 +155,7 @@ class CurveRow(QTreeWidgetItem):
154
155
  """Create columns 3..6: color button, style combo, width spin, symbol spin."""
155
156
  # Color in col 3
156
157
  self.color_button = ColorButtonNative(color=self.config.color)
157
- self.color_button.clicked.connect(lambda: self._select_color(self.color_button))
158
+ self.color_button.color_changed.connect(self._on_color_changed)
158
159
  self.tree.setItemWidget(self, 3, self.color_button)
159
160
 
160
161
  # Style in col 4
@@ -177,20 +178,16 @@ class CurveRow(QTreeWidgetItem):
177
178
  self.symbol_spin.setValue(self.config.symbol_size)
178
179
  self.tree.setItemWidget(self, 6, self.symbol_spin)
179
180
 
180
- def _select_color(self, button):
181
+ @SafeSlot(str, verify_sender=True)
182
+ def _on_color_changed(self, new_color: str):
181
183
  """
182
- Selects a new color using a color dialog and applies it to the specified button. Updates
183
- related configuration properties based on the chosen color.
184
+ Update configuration when the color button emits a change.
184
185
 
185
186
  Args:
186
- button: The button widget whose color is being modified.
187
+ new_color (str): The new color in hex format.
187
188
  """
188
- current_color = QColor(button.color())
189
- chosen_color = QColorDialog.getColor(current_color, self.tree, "Select Curve Color")
190
- if chosen_color.isValid():
191
- button.set_color(chosen_color)
192
- self.config.color = chosen_color.name()
193
- self.config.symbol_color = chosen_color.name()
189
+ self.config.color = new_color
190
+ self.config.symbol_color = new_color
194
191
 
195
192
  def add_dap_row(self):
196
193
  """Create a new DAP row as a child. Only valid if source='device'."""
@@ -1,5 +1,8 @@
1
+ from __future__ import annotations
2
+
3
+ from qtpy.QtCore import Signal
1
4
  from qtpy.QtGui import QColor
2
- from qtpy.QtWidgets import QPushButton
5
+ from qtpy.QtWidgets import QColorDialog, QPushButton
3
6
 
4
7
  from bec_widgets import BECWidget, SafeProperty, SafeSlot
5
8
 
@@ -12,6 +15,8 @@ class ColorButtonNative(BECWidget, QPushButton):
12
15
  to guarantee good readability.
13
16
  """
14
17
 
18
+ color_changed = Signal(str)
19
+
15
20
  RPC = False
16
21
  PLUGIN = True
17
22
  ICON_NAME = "colors"
@@ -25,9 +30,10 @@ class ColorButtonNative(BECWidget, QPushButton):
25
30
  """
26
31
  super().__init__(parent=parent, **kwargs)
27
32
  self.set_color(color)
33
+ self.clicked.connect(self._open_color_dialog)
28
34
 
29
35
  @SafeSlot()
30
- def set_color(self, color):
36
+ def set_color(self, color: str | QColor):
31
37
  """Set the button's color and update its appearance.
32
38
 
33
39
  Args:
@@ -38,6 +44,7 @@ class ColorButtonNative(BECWidget, QPushButton):
38
44
  else:
39
45
  self._color = color
40
46
  self._update_appearance()
47
+ self.color_changed.emit(self._color)
41
48
 
42
49
  @SafeProperty("QColor")
43
50
  def color(self):
@@ -56,3 +63,11 @@ class ColorButtonNative(BECWidget, QPushButton):
56
63
  text_color = "#000000" if brightness > 0.5 else "#FFFFFF"
57
64
  self.setStyleSheet(f"background-color: {self._color}; color: {text_color};")
58
65
  self.setText(self._color)
66
+
67
+ @SafeSlot()
68
+ def _open_color_dialog(self):
69
+ """Open a QColorDialog and apply the selected color."""
70
+ current_color = QColor(self._color)
71
+ chosen_color = QColorDialog.getColor(current_color, self, "Select Curve Color")
72
+ if chosen_color.isValid():
73
+ self.set_color(chosen_color)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bec_widgets
3
- Version: 2.10.2
3
+ Version: 2.10.3
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
@@ -2,11 +2,11 @@
2
2
  .gitlab-ci.yml,sha256=1nMYldzVk0tFkBWYTcUjumOrdSADASheWOAc0kOFDYs,9509
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=ivqg3HTaOxNbEW3bzWh9MXAkrekuGoNdj0Mj3SdRYuw,639
5
- CHANGELOG.md,sha256=kLqgy6w0RZAc0p-MpRNLaWNxn5HJuoRkrurPJ6P4mOc,292878
5
+ CHANGELOG.md,sha256=cWrA4_qflE6UwtdjVRKaazD6sHWKNKRysZZ4ks6dWNI,293110
6
6
  LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
7
- PKG-INFO,sha256=zmW1jybpTovUqp1f3Ag7vvvHALNCC6cgZ5vpo6xtQwg,1254
7
+ PKG-INFO,sha256=Srgpj3zqyK5vthPGAPDziOYXfH_LYjLNYDT97SgjTuY,1254
8
8
  README.md,sha256=oY5Jc1uXehRASuwUJ0umin2vfkFh7tHF-LLruHTaQx0,3560
9
- pyproject.toml,sha256=aoMeS7K08mG5d7iEmQo_Sx8Y_o6xOxN5Qx2blQt7vbY,2835
9
+ pyproject.toml,sha256=bHRGb77fRv3z8fPACmRZ1tuwrHgEzFbebpQJO1tbpjc,2835
10
10
  .git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
11
11
  .github/pull_request_template.md,sha256=F_cJXzooWMFgMGtLK-7KeGcQt0B4AYFse5oN0zQ9p6g,801
12
12
  .github/ISSUE_TEMPLATE/bug_report.yml,sha256=WdRnt7HGxvsIBLzhkaOWNfg8IJQYa_oV9_F08Ym6znQ,1081
@@ -316,7 +316,7 @@ bec_widgets/widgets/plots/waveform/waveform_plugin.py,sha256=2AZPtBHs75l9cdhwQnY
316
316
  bec_widgets/widgets/plots/waveform/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
317
  bec_widgets/widgets/plots/waveform/settings/curve_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
318
318
  bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_setting.py,sha256=Q-wgtzsllExbeOxQoCPmcCQfKRjp_hJeYcinSSy_0HI,4454
319
- bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py,sha256=P_503kqKzKcSwkDnjCfB-u0zLTZGoMEbCsR-xAACtww,21030
319
+ bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py,sha256=Os5u5ZP4L7erClXtkuHMHMvf-a1dTO7ZL8W9Rk3nnWY,20742
320
320
  bec_widgets/widgets/plots/waveform/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
321
321
  bec_widgets/widgets/plots/waveform/utils/roi_manager.py,sha256=zCl3-p3qP02zi837Udz8VUzsbUAwiP-26K3VpLsvaUU,2964
322
322
  bec_widgets/widgets/progress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -384,7 +384,7 @@ bec_widgets/widgets/utility/visual/color_button/color_button.pyproject,sha256=LU
384
384
  bec_widgets/widgets/utility/visual/color_button/color_button_plugin.py,sha256=Eqp6eW1Iu1uS40_rHzgA_Hxy1F6Co7pzv2fdz5cWNGU,1282
385
385
  bec_widgets/widgets/utility/visual/color_button/register_color_button.py,sha256=BD1XGznJqYX3DgUPy2HWDgzu8KdLspR6wagseG5Bo2s,507
386
386
  bec_widgets/widgets/utility/visual/color_button_native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
387
- bec_widgets/widgets/utility/visual/color_button_native/color_button_native.py,sha256=8GgEOSQ86ZWaaGj_6iFExbQSuFmdP72N_GywCRUWVxQ,1833
387
+ bec_widgets/widgets/utility/visual/color_button_native/color_button_native.py,sha256=M7owSqPjYIlOou9U-M9Sxp7QzaIN2Q3cWeWkDdTjlDA,2383
388
388
  bec_widgets/widgets/utility/visual/color_button_native/color_button_native.pyproject,sha256=ceGob3QdHeAvyTj5RQTuxpUB2hNFh3nhRfNpHep4K_k,37
389
389
  bec_widgets/widgets/utility/visual/color_button_native/color_button_native_plugin.py,sha256=RfGUHfLRqRfXGbDAR6SJ46OleXaXEmXyfCjqtQ9yjBs,1389
390
390
  bec_widgets/widgets/utility/visual/color_button_native/register_color_button_native.py,sha256=-TLOcJNpg0hsUaGBNPhWFrzgVwSmXuk8xtY48zAERSc,533
@@ -403,8 +403,8 @@ bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py,sha256=O
403
403
  bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.pyproject,sha256=Lbi9zb6HNlIq14k6hlzR-oz6PIFShBuF7QxE6d87d64,34
404
404
  bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button_plugin.py,sha256=CzChz2SSETYsR8-36meqWnsXCT-FIy_J_xeU5coWDY8,1350
405
405
  bec_widgets/widgets/utility/visual/dark_mode_button/register_dark_mode_button.py,sha256=rMpZ1CaoucwobgPj1FuKTnt07W82bV1GaSYdoqcdMb8,521
406
- bec_widgets-2.10.2.dist-info/METADATA,sha256=zmW1jybpTovUqp1f3Ag7vvvHALNCC6cgZ5vpo6xtQwg,1254
407
- bec_widgets-2.10.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
408
- bec_widgets-2.10.2.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
409
- bec_widgets-2.10.2.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
410
- bec_widgets-2.10.2.dist-info/RECORD,,
406
+ bec_widgets-2.10.3.dist-info/METADATA,sha256=Srgpj3zqyK5vthPGAPDziOYXfH_LYjLNYDT97SgjTuY,1254
407
+ bec_widgets-2.10.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
408
+ bec_widgets-2.10.3.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
409
+ bec_widgets-2.10.3.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
410
+ bec_widgets-2.10.3.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "2.10.2"
7
+ version = "2.10.3"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [