mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-13 11:11:49 +02:00
fix: refactor textbox widget, remove inheritance, adhere to bec style; closes #324
This commit is contained in:
BIN
docs/assets/widget_screenshots/text_box_properties.png
Normal file
BIN
docs/assets/widget_screenshots/text_box_properties.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 81 KiB |
@ -36,7 +36,7 @@ waveform.dap_summary_update.connect(lmfit_dialog.update_summary_tree)
|
||||
````
|
||||
````{tab} API
|
||||
```{eval-rst}
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.cli.client.LMFitDialog.rst
|
||||
.. include:: /api_reference/_autosummary/bec_widgets.widgets.lmfit_dialog.lmfit_dialog.LMFitDialog.rst
|
||||
```
|
||||
````
|
||||
|
||||
|
@ -30,6 +30,7 @@ Within the BECDesigner's [property editor](https://doc.qt.io/qt-6/designer-widge
|
||||
- **Hide Scan Control**: Allows you to hide the scan control buttons from the widget interface. This is useful when you want to place the control buttons in a different location.
|
||||
- **Hide Scan Selection**: Allows you to hide the scan selection combobox from the widget interface. This is useful when you want to restrict the user to a specific scan type or implement a custom scan selection mechanism.
|
||||
- **Hide Scan Remember Toggle**: Allows you to hide the toggle button that reloads scan parameters from the last executed scan. This is useful if you want to disable or restrict this functionality in specific scenarios.
|
||||
- **Hide Bundle Buttons**: Allows you to hide the buttons that add or remove argument bundles from the widget interface. This is useful when you want to restrict the user from adding additional motor bundles to the scan by accident.
|
||||
|
||||
**BEC Designer properties:**
|
||||
```{figure} ./hide_scan_control.png
|
||||
|
@ -8,8 +8,11 @@ The [`Text Box Widget`](/api_reference/_autosummary/bec_widgets.cli.client.TextB
|
||||
|
||||
## Key Features:
|
||||
- **Text Display**: Display either plain text or HTML content, with automatic detection of the format.
|
||||
- **Customizable Appearance**: Set the background and font colors to match the design of your application.
|
||||
- **Font Size Adjustment**: Customize the font size of the displayed text for better readability.
|
||||
- **Automatic styling**: The widget automatically adheres to BEC's style guides. No need to worry about background colors, font sizes, or other appearance settings.
|
||||
|
||||
## BEC Designer Properties
|
||||
```{figure} ../../assets/widget_screenshots/text_box_properties.png
|
||||
```
|
||||
|
||||
````
|
||||
|
||||
@ -38,24 +41,6 @@ The `TextBox` widget can automatically detect and render HTML content. This exam
|
||||
text_box.set_text("<h1>Welcome to BEC Widgets</h1><p>This is an example of displaying <strong>HTML</strong> text.</p>")
|
||||
```
|
||||
|
||||
## Example 3 - Customizing Appearance
|
||||
|
||||
The `TextBox` widget allows you to customize the background and font colors to fit your application's design. Below is an example of how to set these properties.
|
||||
|
||||
```python
|
||||
# Set the background color to white and the font color to black
|
||||
text_box.set_color(background_color="#FFF", font_color="#000")
|
||||
```
|
||||
|
||||
## Example 4 - Adjusting Font Size
|
||||
|
||||
To improve readability or fit more text within the widget, you can adjust the font size.
|
||||
|
||||
```python
|
||||
# Set the font size to 14 pixels
|
||||
text_box.set_font_size(14)
|
||||
```
|
||||
|
||||
````
|
||||
|
||||
````{tab} API
|
||||
|
Reference in New Issue
Block a user