A collection of static utility functions used throughout the Wavelength application.
More...
#include <wavelength_utilities.h>
|
| static void | CenterLabel (QLabel *label, const BlobAnimation *animation) |
| | Centers a QLabel widget within the bounds of a BlobAnimation widget. Calculates the appropriate geometry for the label based on its size hint and the animation widget's dimensions, then applies it and raises the label to ensure visibility.
|
| |
| static double | NormalizeFrequency (double frequency) |
| | Normalizes a frequency value by formatting it to one decimal place. Converts the double to a string with one decimal place and then back to a double. This effectively rounds or truncates the frequency to a standard format.
|
| |
| static void | UpdateTitleLabelStyle (QLabel *label, const QColor &text_color, const QColor &border_color) |
| | Applies a specific cyberpunk-themed stylesheet to a QLabel, intended for title elements. Sets the font, letter spacing, text color, border color, border radius, padding, and text transformation.
|
| |
A collection of static utility functions used throughout the Wavelength application.
This class provides helper methods for common tasks such as frequency formatting, UI element positioning, and style updates.
◆ CenterLabel()
| void WavelengthUtilities::CenterLabel |
( |
QLabel * | label, |
|
|
const BlobAnimation * | animation ) |
|
static |
Centers a QLabel widget within the bounds of a BlobAnimation widget. Calculates the appropriate geometry for the label based on its size hint and the animation widget's dimensions, then applies it and raises the label to ensure visibility.
- Parameters
-
| label | Pointer to the QLabel to be centered. |
| animation | Pointer to the BlobAnimation widget serving as the reference area. |
◆ NormalizeFrequency()
| double WavelengthUtilities::NormalizeFrequency |
( |
double | frequency | ) |
|
|
static |
Normalizes a frequency value by formatting it to one decimal place. Converts the double to a string with one decimal place and then back to a double. This effectively rounds or truncates the frequency to a standard format.
- Parameters
-
| frequency | The frequency value (in Hz, kHz, or MHz) to normalize. |
- Returns
- The normalized frequency value as a double, or the original value if conversion fails.
◆ UpdateTitleLabelStyle()
| void WavelengthUtilities::UpdateTitleLabelStyle |
( |
QLabel * | label, |
|
|
const QColor & | text_color, |
|
|
const QColor & | border_color ) |
|
static |
Applies a specific cyberpunk-themed stylesheet to a QLabel, intended for title elements. Sets the font, letter spacing, text color, border color, border radius, padding, and text transformation.
- Parameters
-
| label | Pointer to the QLabel to be styled. |
| text_color | The desired color for the label's text. |
| border_color | The desired color for the label's border. |
The documentation for this class was generated from the following files: