bec-widgets 0.108.0__tar.gz → 0.109.1__tar.gz

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 (258) hide show
  1. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/CHANGELOG.md +16 -14
  2. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/PKG-INFO +1 -1
  3. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/client.py +5 -15
  4. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/bec_widget.py +1 -1
  5. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/colors.py +21 -6
  6. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_progressbar/bec_progressbar.py +2 -1
  7. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dark_mode_button/dark_mode_button.py +1 -1
  8. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/plot_base.py +1 -1
  9. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/waveform/waveform.py +2 -1
  10. bec_widgets-0.109.1/bec_widgets/widgets/text_box/text_box.py +135 -0
  11. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/pyproject.toml +1 -1
  12. bec_widgets-0.108.0/bec_widgets/widgets/text_box/text_box.py +0 -129
  13. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.git_hooks/pre-commit +0 -0
  14. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.gitignore +0 -0
  15. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.gitlab/issue_templates/bug_report_template.md +0 -0
  16. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.gitlab/issue_templates/documentation_update_template.md +0 -0
  17. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.gitlab/issue_templates/feature_request_template.md +0 -0
  18. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.gitlab/merge_request_templates/default.md +0 -0
  19. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.gitlab-ci.yml +0 -0
  20. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.pylintrc +0 -0
  21. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/.readthedocs.yaml +0 -0
  22. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/LICENSE +0 -0
  23. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/README.md +0 -0
  24. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/__init__.py +0 -0
  25. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/app_icons/BEC-General-App.png +0 -0
  26. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/app_icons/bec_widgets_icon.png +0 -0
  27. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/status_icons/error.svg +0 -0
  28. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/status_icons/not_connected.svg +0 -0
  29. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/status_icons/refresh.svg +0 -0
  30. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/status_icons/running.svg +0 -0
  31. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/assets/status_icons/warning.svg +0 -0
  32. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/__init__.py +0 -0
  33. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/auto_updates.py +0 -0
  34. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/client_utils.py +0 -0
  35. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/generate_cli.py +0 -0
  36. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/rpc_register.py +0 -0
  37. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/rpc_wigdet_handler.py +0 -0
  38. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/cli/server.py +0 -0
  39. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/__init__.py +0 -0
  40. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/general_app/__init__.py +0 -0
  41. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/general_app/general_app.py +0 -0
  42. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/general_app/general_app.ui +0 -0
  43. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/general_app/web_links.py +0 -0
  44. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/jupyter_console/__init__.py +0 -0
  45. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/jupyter_console/jupyter_console_window.py +0 -0
  46. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/__init__.py +0 -0
  47. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/main.py +0 -0
  48. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/registertictactoe.py +0 -0
  49. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/taskmenuextension.pyproject +0 -0
  50. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/tictactoe.py +0 -0
  51. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/tictactoeplugin.py +0 -0
  52. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/examples/plugin_example_pyside/tictactoetaskmenu.py +0 -0
  53. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/qt_utils/__init__.py +0 -0
  54. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/qt_utils/error_popups.py +0 -0
  55. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/qt_utils/redis_message_waiter.py +0 -0
  56. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/qt_utils/settings_dialog.py +0 -0
  57. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/qt_utils/toolbar.py +0 -0
  58. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/__init__.py +0 -0
  59. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/bec_connector.py +0 -0
  60. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/bec_designer.py +0 -0
  61. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/bec_dispatcher.py +0 -0
  62. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/bec_table.py +0 -0
  63. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/container_utils.py +0 -0
  64. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/crosshair.py +0 -0
  65. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/entry_validator.py +0 -0
  66. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/generate_designer_plugin.py +0 -0
  67. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/layout_manager.py +0 -0
  68. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/linear_region_selector.py +0 -0
  69. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/plugin_templates/plugin.template +0 -0
  70. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/plugin_templates/register.template +0 -0
  71. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/plugin_utils.py +0 -0
  72. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/reference_utils.py +0 -0
  73. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/rpc_decorator.py +0 -0
  74. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/thread_checker.py +0 -0
  75. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/ui_loader.py +0 -0
  76. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/validator_delegate.py +0 -0
  77. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/widget_io.py +0 -0
  78. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/utils/yaml_dialog.py +0 -0
  79. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/__init__.py +0 -0
  80. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/base_classes/__init__.py +0 -0
  81. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/base_classes/device_input_base.py +0 -0
  82. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_progressbar/__init__.py +0 -0
  83. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_progressbar/bec_progress_bar.pyproject +0 -0
  84. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_progressbar/bec_progress_bar_plugin.py +0 -0
  85. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_progressbar/register_bec_progress_bar.py +0 -0
  86. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_queue/__init__.py +0 -0
  87. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_queue/bec_queue.py +0 -0
  88. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_queue/bec_queue.pyproject +0 -0
  89. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_queue/bec_queue_plugin.py +0 -0
  90. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_queue/register_bec_queue.py +0 -0
  91. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_status_box/__init__.py +0 -0
  92. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_status_box/bec_status_box.py +0 -0
  93. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_status_box/bec_status_box.pyproject +0 -0
  94. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +0 -0
  95. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_status_box/register_bec_status_box.py +0 -0
  96. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/bec_status_box/status_item.py +0 -0
  97. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_abort/__init__.py +0 -0
  98. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_abort/abort_button.pyproject +0 -0
  99. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_abort/abort_button_plugin.py +0 -0
  100. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_abort/button_abort.py +0 -0
  101. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_abort/register_abort_button.py +0 -0
  102. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_reset/__init__.py +0 -0
  103. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_reset/button_reset.py +0 -0
  104. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_reset/register_reset_button.py +0 -0
  105. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_reset/reset_button.pyproject +0 -0
  106. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_reset/reset_button_plugin.py +0 -0
  107. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_resume/__init__.py +0 -0
  108. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_resume/button_resume.py +0 -0
  109. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_resume/register_resume_button.py +0 -0
  110. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_resume/resume_button.pyproject +0 -0
  111. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/button_resume/resume_button_plugin.py +0 -0
  112. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/color_button/__init__.py +0 -0
  113. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/color_button/color_button.py +0 -0
  114. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/color_button/color_button.pyproject +0 -0
  115. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/color_button/color_button_plugin.py +0 -0
  116. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/color_button/register_color_button.py +0 -0
  117. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/colormap_selector/__init__.py +0 -0
  118. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/colormap_selector/colormap_selector.py +0 -0
  119. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/colormap_selector/colormap_selector.pyproject +0 -0
  120. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py +0 -0
  121. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/colormap_selector/register_colormap_selector.py +0 -0
  122. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/console/console.py +0 -0
  123. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dap_combo_box/__init__.py +0 -0
  124. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dap_combo_box/dap_combo_box.py +0 -0
  125. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dap_combo_box/dap_combo_box.pyproject +0 -0
  126. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dap_combo_box/dap_combo_box_plugin.py +0 -0
  127. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dap_combo_box/register_dap_combo_box.py +0 -0
  128. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dark_mode_button/__init__.py +0 -0
  129. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dark_mode_button/dark_mode_button.pyproject +0 -0
  130. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dark_mode_button/dark_mode_button_plugin.py +0 -0
  131. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dark_mode_button/register_dark_mode_button.py +0 -0
  132. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/__init__.py +0 -0
  133. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/device_browser.py +0 -0
  134. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/device_browser.pyproject +0 -0
  135. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/device_browser.ui +0 -0
  136. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/device_browser_plugin.py +0 -0
  137. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/device_item/__init__.py +0 -0
  138. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/device_item/device_item.py +0 -0
  139. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_browser/register_device_browser.py +0 -0
  140. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_combobox/__init__.py +0 -0
  141. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_combobox/device_combo_box.pyproject +0 -0
  142. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_combobox/device_combo_box_plugin.py +0 -0
  143. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_combobox/device_combobox.py +0 -0
  144. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_combobox/register_device_combo_box.py +0 -0
  145. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_line_edit/__init__.py +0 -0
  146. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_line_edit/device_line_edit.py +0 -0
  147. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_line_edit/device_line_edit.pyproject +0 -0
  148. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +0 -0
  149. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/device_line_edit/register_device_line_edit.py +0 -0
  150. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dock/__init__.py +0 -0
  151. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dock/dock.py +0 -0
  152. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dock/dock_area.py +0 -0
  153. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dock/dock_area.pyproject +0 -0
  154. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dock/dock_area_plugin.py +0 -0
  155. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/dock/register_dock_area.py +0 -0
  156. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/__init__.py +0 -0
  157. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/figure.py +0 -0
  158. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/__init__.py +0 -0
  159. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/axis_settings.py +0 -0
  160. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/axis_settings.ui +0 -0
  161. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/image/__init__.py +0 -0
  162. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/image/image.py +0 -0
  163. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/image/image_item.py +0 -0
  164. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/image/image_processor.py +0 -0
  165. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/motor_map/__init__.py +0 -0
  166. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/motor_map/motor_map.py +0 -0
  167. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/waveform/__init__.py +0 -0
  168. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +0 -0
  169. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/image/__init__.py +0 -0
  170. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/image/bec_image_widget.pyproject +0 -0
  171. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/image/bec_image_widget_plugin.py +0 -0
  172. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/image/image_widget.py +0 -0
  173. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/image/register_bec_image_widget.py +0 -0
  174. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/jupyter_console/__init__.py +0 -0
  175. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/jupyter_console/jupyter_console.py +0 -0
  176. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/__init__.py +0 -0
  177. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/lm_fit_dialog.pyproject +0 -0
  178. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/lm_fit_dialog_plugin.py +0 -0
  179. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/lmfit_dialog.py +0 -0
  180. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/lmfit_dialog_compact.ui +0 -0
  181. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/lmfit_dialog_vertical.ui +0 -0
  182. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/lmfit_dialog/register_lm_fit_dialog.py +0 -0
  183. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/__init__.py +0 -0
  184. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/bec_motor_map_widget.pyproject +0 -0
  185. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py +0 -0
  186. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/motor_map_dialog/__init__.py +0 -0
  187. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/motor_map_dialog/motor_map_settings.py +0 -0
  188. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/motor_map_dialog/motor_map_settings.ui +0 -0
  189. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/motor_map_widget.py +0 -0
  190. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/motor_map/register_bec_motor_map_widget.py +0 -0
  191. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/position_indicator/__init__.py +0 -0
  192. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/position_indicator/position_indicator.py +0 -0
  193. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/position_indicator/position_indicator.pyproject +0 -0
  194. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/position_indicator/position_indicator_plugin.py +0 -0
  195. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/position_indicator/register_position_indicator.py +0 -0
  196. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/__init__.py +0 -0
  197. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_box.py +0 -0
  198. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_box.pyproject +0 -0
  199. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_box.ui +0 -0
  200. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_box_plugin.py +0 -0
  201. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_control_line.py +0 -0
  202. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_control_line.pyproject +0 -0
  203. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_control_line.ui +0 -0
  204. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +0 -0
  205. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/register_positioner_box.py +0 -0
  206. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/positioner_box/register_positioner_control_line.py +0 -0
  207. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/ring_progress_bar/__init__.py +0 -0
  208. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/ring_progress_bar/register_ring_progress_bar.py +0 -0
  209. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/ring_progress_bar/ring.py +0 -0
  210. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +0 -0
  211. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/ring_progress_bar/ring_progress_bar.pyproject +0 -0
  212. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +0 -0
  213. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/scan_control/__init__.py +0 -0
  214. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/scan_control/register_scan_control.py +0 -0
  215. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/scan_control/scan_control.py +0 -0
  216. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/scan_control/scan_control.pyproject +0 -0
  217. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/scan_control/scan_control_plugin.py +0 -0
  218. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/scan_control/scan_group_box.py +0 -0
  219. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/spinner/__init__.py +0 -0
  220. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/spinner/register_spinner_widget.py +0 -0
  221. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/spinner/spinner.py +0 -0
  222. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/spinner/spinner_widget.pyproject +0 -0
  223. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/spinner/spinner_widget_plugin.py +0 -0
  224. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/stop_button/__init__.py +0 -0
  225. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/stop_button/register_stop_button.py +0 -0
  226. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/stop_button/stop_button.py +0 -0
  227. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/stop_button/stop_button.pyproject +0 -0
  228. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/stop_button/stop_button_plugin.py +0 -0
  229. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/text_box/__init__.py +0 -0
  230. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/text_box/register_text_box.py +0 -0
  231. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/text_box/text_box.pyproject +0 -0
  232. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/text_box/text_box_plugin.py +0 -0
  233. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/toggle/__init__.py +0 -0
  234. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/toggle/register_toggle_switch.py +0 -0
  235. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/toggle/toggle.py +0 -0
  236. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/toggle/toggle_switch.pyproject +0 -0
  237. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/toggle/toggle_switch_plugin.py +0 -0
  238. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/vscode/__init__.py +0 -0
  239. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/vscode/register_vs_code_editor.py +0 -0
  240. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/vscode/vs_code_editor.pyproject +0 -0
  241. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/vscode/vs_code_editor_plugin.py +0 -0
  242. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/vscode/vscode.py +0 -0
  243. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/__init__.py +0 -0
  244. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/bec_waveform_widget.pyproject +0 -0
  245. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +0 -0
  246. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/register_bec_waveform_widget.py +0 -0
  247. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_popups/__init__.py +0 -0
  248. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_popups/curve_dialog/__init__.py +0 -0
  249. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +0 -0
  250. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.ui +0 -0
  251. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/__init__.py +0 -0
  252. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_popups/dap_summary_dialog/dap_summary_dialog.py +0 -0
  253. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/waveform/waveform_widget.py +0 -0
  254. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/website/__init__.py +0 -0
  255. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/website/register_website_widget.py +0 -0
  256. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/website/website.py +0 -0
  257. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/website/website_widget.pyproject +0 -0
  258. {bec_widgets-0.108.0 → bec_widgets-0.109.1}/bec_widgets/widgets/website/website_widget_plugin.py +0 -0
@@ -1,5 +1,21 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.109.1 (2024-09-09)
4
+
5
+ ### Fix
6
+
7
+ * fix: refactor textbox widget, remove inheritance, adhere to bec style; closes #324 ([`b0d786b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b0d786b991677c0846a0c6ba3f2252d48d94ccaa))
8
+
9
+ ## v0.109.0 (2024-09-06)
10
+
11
+ ### Feature
12
+
13
+ * feat(accent colors): added helper function to get all accent colors ([`84a59f7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/84a59f70eed6d8a3c3aeeabc77a5f9ea4e864f61))
14
+
15
+ ### Fix
16
+
17
+ * fix(theme): fixed theme access for themecontainer ([`de303f0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/de303f0227fc9d3a74a0410f1e7999ac5132273c))
18
+
3
19
  ## v0.108.0 (2024-09-06)
4
20
 
5
21
  ### Documentation
@@ -144,20 +160,6 @@
144
160
 
145
161
  * docs(becwidget): improvements to the bec widget base class docs; fixed type hint import for sphinx ([`99d5e8e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/99d5e8e71c7f89a53d7967126f4056dde005534c))
146
162
 
147
- ### Feature
148
-
149
- * feat(theme): added theme handler to bec widget base class; added tests ([`7fb938a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7fb938a8506685278ee5eeb6fe9a03f74b713cf8))
150
-
151
163
  ### Fix
152
164
 
153
165
  * fix(pyqt slot): removed slot decorator to avoid problems with pyqt6 ([`6c1f89a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6c1f89ad39b7240ab1d1c1123422b99ae195bf01))
154
-
155
- ## v0.99.15 (2024-08-31)
156
-
157
- ### Fix
158
-
159
- * fix(theme): update pg axes on theme update ([`af23e74`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/af23e74f71152f4abc319ab7b45e65deefde3519))
160
-
161
- * fix(positioner_box): fixed positioner box dialog; added test; closes #332 ([`0bf1cf9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0bf1cf9b8ab2f9171d5ff63d4e3672eb93e9a5fa))
162
-
163
- ## v0.99.14 (2024-08-30)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.108.0
3
+ Version: 0.109.1
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
@@ -2914,31 +2914,21 @@ class StopButton(RPCBase):
2914
2914
 
2915
2915
  class TextBox(RPCBase):
2916
2916
  @rpc_call
2917
- def set_color(self, background_color: str, font_color: str) -> None:
2917
+ def set_plain_text(self, text: str) -> None:
2918
2918
  """
2919
- Set the background color of the widget.
2920
-
2921
- Args:
2922
- background_color (str): The color to set the background in HEX.
2923
- font_color (str): The color to set the font in HEX.
2924
- """
2925
-
2926
- @rpc_call
2927
- def set_text(self, text: str) -> None:
2928
- """
2929
- Set the text of the widget.
2919
+ Set the plain text of the widget.
2930
2920
 
2931
2921
  Args:
2932
2922
  text (str): The text to set.
2933
2923
  """
2934
2924
 
2935
2925
  @rpc_call
2936
- def set_font_size(self, size: int) -> None:
2926
+ def set_html_text(self, text: str) -> None:
2937
2927
  """
2938
- Set the font size of the text in the widget.
2928
+ Set the HTML text of the widget.
2939
2929
 
2940
2930
  Args:
2941
- size (int): The font size to set.
2931
+ text (str): The text to set.
2942
2932
  """
2943
2933
 
2944
2934
 
@@ -71,7 +71,7 @@ class BECWidget(BECConnector):
71
71
  if theme is None:
72
72
  qapp = QApplication.instance()
73
73
  if hasattr(qapp, "theme"):
74
- theme = qapp.theme["theme"]
74
+ theme = qapp.theme.theme
75
75
  else:
76
76
  theme = "dark"
77
77
  self.apply_theme(theme)
@@ -1,6 +1,8 @@
1
+ from __future__ import annotations
2
+
1
3
  import itertools
2
4
  import re
3
- from typing import Literal
5
+ from typing import TYPE_CHECKING, Literal
4
6
 
5
7
  import bec_qthemes
6
8
  import numpy as np
@@ -8,25 +10,38 @@ import pyqtgraph as pg
8
10
  from bec_qthemes._os_appearance.listener import OSThemeSwitchListener
9
11
  from pydantic_core import PydanticCustomError
10
12
  from qtpy.QtGui import QColor
11
- from qtpy.QtWidgets import QApplication, QPushButton, QToolButton
13
+ from qtpy.QtWidgets import QApplication
14
+
15
+ if TYPE_CHECKING:
16
+ from bec_qthemes._main import AccentColors
12
17
 
13
18
 
14
19
  def get_theme_palette():
15
20
  if QApplication.instance() is None or not hasattr(QApplication.instance(), "theme"):
16
21
  theme = "dark"
17
22
  else:
18
- theme = QApplication.instance().theme["theme"]
23
+ theme = QApplication.instance().theme.theme
19
24
  return bec_qthemes.load_palette(theme)
20
25
 
21
26
 
27
+ def get_accent_colors() -> AccentColors | None:
28
+ """
29
+ Get the accent colors for the current theme. These colors are extensions of the color palette
30
+ and are used to highlight specific elements in the UI.
31
+ """
32
+ if QApplication.instance() is None or not hasattr(QApplication.instance(), "theme"):
33
+ return None
34
+ return QApplication.instance().theme.accent_colors
35
+
36
+
22
37
  def _theme_update_callback():
23
38
  """
24
39
  Internal callback function to update the theme based on the system theme.
25
40
  """
26
41
  app = QApplication.instance()
27
42
  # pylint: disable=protected-access
28
- app.theme["theme"] = app.os_listener._theme.lower()
29
- app.theme_signal.theme_updated.emit(app.theme["theme"])
43
+ app.theme.theme = app.os_listener._theme.lower()
44
+ app.theme_signal.theme_updated.emit(app.theme.theme)
30
45
  apply_theme(app.os_listener._theme.lower())
31
46
 
32
47
 
@@ -124,7 +139,7 @@ class Colors:
124
139
  color_index = int(color_selection[ii])
125
140
  color = cmap_colors[color_index]
126
141
  app = QApplication.instance()
127
- if hasattr(app, "theme") and app.theme["theme"] == "light":
142
+ if hasattr(app, "theme") and app.theme.theme == "light":
128
143
  background = 255
129
144
  else:
130
145
  background = 0
@@ -6,6 +6,7 @@ from qtpy.QtGui import QColor, QPainter, QPainterPath
6
6
  from qtpy.QtWidgets import QApplication, QLabel, QVBoxLayout, QWidget
7
7
 
8
8
  from bec_widgets.utils.bec_widget import BECWidget
9
+ from bec_widgets.utils.colors import get_accent_colors
9
10
 
10
11
 
11
12
  class BECProgressBar(BECWidget, QWidget):
@@ -26,7 +27,7 @@ class BECProgressBar(BECWidget, QWidget):
26
27
  super().__init__(client=client, config=config, gui_id=gui_id)
27
28
  QWidget.__init__(self, parent=parent)
28
29
 
29
- accent_colors = QApplication.instance().theme.accent_colors
30
+ accent_colors = get_accent_colors()
30
31
 
31
32
  # internal values
32
33
  self._oversampling_factor = 50
@@ -60,7 +60,7 @@ class DarkModeButton(BECWidget, QWidget):
60
60
  bool: True if dark mode is enabled, False otherwise.
61
61
  """
62
62
  qapp = QApplication.instance()
63
- if hasattr(qapp, "theme") and qapp.theme["theme"] == "dark":
63
+ if hasattr(qapp, "theme") and qapp.theme.theme == "dark":
64
64
  return True
65
65
 
66
66
  return False
@@ -119,7 +119,7 @@ class BECPlotBase(BECConnector, pg.GraphicsLayout):
119
119
  if theme is None:
120
120
  qapp = QApplication.instance()
121
121
  if hasattr(qapp, "theme"):
122
- theme = qapp.theme["theme"]
122
+ theme = qapp.theme.theme
123
123
  else:
124
124
  theme = "dark"
125
125
  self.apply_theme(theme)
@@ -16,6 +16,7 @@ from qtpy.QtWidgets import QApplication, QWidget
16
16
 
17
17
  from bec_widgets.qt_utils.error_popups import SafeSlot as Slot
18
18
  from bec_widgets.utils import Colors, EntryValidator
19
+ from bec_widgets.utils.colors import get_accent_colors
19
20
  from bec_widgets.utils.linear_region_selector import LinearRegionWrapper
20
21
  from bec_widgets.widgets.figure.plots.plot_base import BECPlotBase, SubplotConfig
21
22
  from bec_widgets.widgets.figure.plots.waveform.waveform_curve import (
@@ -108,7 +109,7 @@ class BECWaveform(BECPlotBase):
108
109
  self.scan_item = None
109
110
  self._roi_region = None
110
111
  self.roi_select = None
111
- self._accent_colors = QApplication.instance().theme.accent_colors
112
+ self._accent_colors = get_accent_colors()
112
113
  self._x_axis_mode = {
113
114
  "name": None,
114
115
  "entry": None,
@@ -0,0 +1,135 @@
1
+ """Module for a text box widget that displays text in plain and HTML format and adheres to the BECWidget interface & style."""
2
+
3
+ import re
4
+ from html.parser import HTMLParser
5
+
6
+ from bec_lib.logger import bec_logger
7
+ from pydantic import Field
8
+ from qtpy.QtCore import Property, Slot
9
+ from qtpy.QtWidgets import QTextEdit, QVBoxLayout, QWidget
10
+
11
+ from bec_widgets.utils.bec_connector import ConnectionConfig
12
+ from bec_widgets.utils.bec_widget import BECWidget
13
+
14
+ logger = bec_logger.logger
15
+
16
+ DEFAULT_TEXT = "<h1>Welcome to the BEC Widget TextBox</h1><p>A widget that allows user to display text in plain and HTML format.</p><p>This is an example of displaying HTML text.</p>"
17
+
18
+
19
+ class TextBoxConfig(ConnectionConfig):
20
+ """Configuration for the TextBox widget.
21
+
22
+ Args:
23
+ text (str, optional): The text to display in the widget. Defaults to None.
24
+ is_html (bool, optional): Whether the text is in HTML format or not. Defaults to False.
25
+ """
26
+
27
+ text: str | None = Field(None, description="The text to display in the widget.")
28
+ is_html: bool = Field(False, description="Whether the text is in HTML format or not.")
29
+
30
+
31
+ class TextBox(BECWidget, QWidget):
32
+ """A widget that displays text in plain and HTML format
33
+
34
+ Args:
35
+ parent (QWidget, optional): The parent widget. Defaults to None.
36
+ client ([type], optional): The client to use. Defaults to None.
37
+ config ([type], optional): The config to use. Defaults to None.
38
+ gui_id ([type], optional): The gui_id to use. Defaults to None.
39
+ """
40
+
41
+ USER_ACCESS = ["set_plain_text", "set_html_text"]
42
+ ICON_NAME = "chat"
43
+
44
+ def __init__(self, parent=None, client=None, config=None, gui_id=None):
45
+ if config is None:
46
+ config = TextBoxConfig(widget_class=self.__class__.__name__)
47
+ else:
48
+ if isinstance(config, dict):
49
+ config = TextBoxConfig(**config)
50
+ self.config = config
51
+ super().__init__(client=client, config=config, gui_id=gui_id)
52
+ QWidget.__init__(self, parent)
53
+ self.layout = QVBoxLayout(self)
54
+ self.text_box_text_edit = QTextEdit(parent=self)
55
+ self.layout.addWidget(self.text_box_text_edit)
56
+ self.setLayout(self.layout)
57
+ self.layout.setContentsMargins(0, 0, 0, 0)
58
+ self.config = config
59
+ self.text_box_text_edit.setReadOnly(True)
60
+ if self.config.text is not None:
61
+ if self.config.is_html:
62
+ self.set_html_text(self.config.text)
63
+ else:
64
+ self.set_plain_text(self.config.text)
65
+ else:
66
+ self.set_html_text(DEFAULT_TEXT)
67
+
68
+ @Slot(str)
69
+ def set_plain_text(self, text: str) -> None:
70
+ """Set the plain text of the widget.
71
+
72
+ Args:
73
+ text (str): The text to set.
74
+ """
75
+ self.text_box_text_edit.setPlainText(text)
76
+ self.config.text = text
77
+ self.config.is_html = False
78
+
79
+ @Slot(str)
80
+ def set_html_text(self, text: str) -> None:
81
+ """Set the HTML text of the widget.
82
+
83
+ Args:
84
+ text (str): The text to set.
85
+ """
86
+ self.text_box_text_edit.setHtml(text)
87
+ self.config.text = text
88
+ self.config.is_html = True
89
+
90
+ @Property(str)
91
+ def plain_text(self) -> str:
92
+ """Get the text of the widget.
93
+
94
+ Returns:
95
+ str: The text of the widget.
96
+ """
97
+ return self.text_box_text_edit.toPlainText()
98
+
99
+ @plain_text.setter
100
+ def plain_text(self, text: str) -> None:
101
+ """Set the text of the widget.
102
+
103
+ Args:
104
+ text (str): The text to set.
105
+ """
106
+ self.set_plain_text(text)
107
+
108
+ @Property(str)
109
+ def html_text(self) -> str:
110
+ """Get the HTML text of the widget.
111
+
112
+ Returns:
113
+ str: The HTML text of the widget.
114
+ """
115
+ return self.text_box_text_edit.toHtml()
116
+
117
+ @html_text.setter
118
+ def html_text(self, text: str) -> None:
119
+ """Set the HTML text of the widget.
120
+
121
+ Args:
122
+ text (str): The HTML text to set.
123
+ """
124
+ self.set_html_text(text)
125
+
126
+
127
+ if __name__ == "__main__":
128
+ import sys
129
+
130
+ from qtpy.QtWidgets import QApplication
131
+
132
+ app = QApplication(sys.argv)
133
+ widget = TextBox()
134
+ widget.show()
135
+ sys.exit(app.exec())
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "0.108.0"
7
+ version = "0.109.1"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -1,129 +0,0 @@
1
- import re
2
-
3
- from pydantic import Field, field_validator
4
- from qtpy.QtWidgets import QTextEdit
5
-
6
- from bec_widgets.utils.bec_connector import ConnectionConfig
7
- from bec_widgets.utils.bec_widget import BECWidget
8
- from bec_widgets.utils.colors import Colors
9
-
10
-
11
- class TextBoxConfig(ConnectionConfig):
12
-
13
- theme: str = Field("dark", description="The theme of the figure widget.")
14
- font_color: str = Field("#FFF", description="The font color of the text")
15
- background_color: str = Field("#000", description="The background color of the widget.")
16
- font_size: int = Field(16, description="The font size of the text in the widget.")
17
- text: str = Field("", description="The text to display in the widget.")
18
-
19
- @classmethod
20
- @field_validator("theme")
21
- def validate_theme(cls, v):
22
- """Validate the theme of the figure widget."""
23
- if v not in ["dark", "light"]:
24
- raise ValueError("Theme must be either 'dark' or 'light'")
25
- return v
26
-
27
- _validate_font_color = field_validator("font_color")(Colors.validate_color)
28
- _validate_background_color = field_validator("background_color")(Colors.validate_color)
29
-
30
-
31
- class TextBox(BECWidget, QTextEdit):
32
-
33
- USER_ACCESS = ["set_color", "set_text", "set_font_size"]
34
- ICON_NAME = "chat"
35
-
36
- def __init__(self, parent=None, text: str = "", client=None, config=None, gui_id=None):
37
- if config is None:
38
- config = TextBoxConfig(widget_class=self.__class__.__name__)
39
- else:
40
- if isinstance(config, dict):
41
- config = TextBoxConfig(**config)
42
- self.config = config
43
- super().__init__(client=client, config=config, gui_id=gui_id)
44
- QTextEdit.__init__(self, parent=parent)
45
-
46
- self.config = config
47
- self.setReadOnly(True)
48
- self.setGeometry(self.rect())
49
- self.set_color(self.config.background_color, self.config.font_color)
50
- if not text:
51
- text = "<h1>Welcome to the BEC Widget TextBox</h1><p>A widget that allows user to display text in plain and HTML format.</p><p>This is an example of displaying HTML text.</p>"
52
- self.set_text(text)
53
-
54
- def change_theme(self) -> None:
55
- """
56
- Change the theme of the figure widget.
57
- """
58
- if self.config.theme == "dark":
59
- theme = "light"
60
- font_color = "#000"
61
- background_color = "#FFF"
62
- else:
63
- theme = "dark"
64
- font_color = "#FFF"
65
- background_color = "#000"
66
- self.config.theme = theme
67
- self.set_color(background_color, font_color)
68
-
69
- def set_color(self, background_color: str, font_color: str) -> None:
70
- """Set the background color of the widget.
71
-
72
- Args:
73
- background_color (str): The color to set the background in HEX.
74
- font_color (str): The color to set the font in HEX.
75
-
76
- """
77
- self.config.background_color = background_color
78
- self.config.font_color = font_color
79
- self._update_stylesheet()
80
-
81
- def set_font_size(self, size: int) -> None:
82
- """Set the font size of the text in the widget.
83
-
84
- Args:
85
- size (int): The font size to set.
86
- """
87
- self.config.font_size = size
88
- self._update_stylesheet()
89
-
90
- def _update_stylesheet(self):
91
- """Update the stylesheet of the widget."""
92
- self.setStyleSheet(
93
- f"background-color: {self.config.background_color}; color: {self.config.font_color}; font-size: {self.config.font_size}px"
94
- )
95
-
96
- def set_text(self, text: str) -> None:
97
- """Set the text of the widget.
98
-
99
- Args:
100
- text (str): The text to set.
101
- """
102
- if self.is_html(text):
103
- self.setHtml(text)
104
- else:
105
- self.setPlainText(text)
106
- self.config.text = text
107
-
108
- def is_html(self, text: str) -> bool:
109
- """Check if the text contains HTML tags.
110
-
111
- Args:
112
- text (str): The text to check.
113
-
114
- Returns:
115
- bool: True if the text contains HTML tags, False otherwise.
116
- """
117
- return bool(re.search(r"<[a-zA-Z/][^>]*>", text))
118
-
119
-
120
- if __name__ == "__main__":
121
- import sys
122
-
123
- from qtpy.QtWidgets import QApplication
124
-
125
- app = QApplication(sys.argv)
126
-
127
- widget = TextBox()
128
- widget.show()
129
- sys.exit(app.exec())
File without changes
File without changes
File without changes
File without changes