Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
WavelengthUtilities Class Reference

A collection of static utility functions used throughout the Wavelength application. More...

#include <wavelength_utilities.h>

Collaboration diagram for WavelengthUtilities:

Static Public Member Functions

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.
 

Detailed Description

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.

Member Function Documentation

◆ 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
labelPointer to the QLabel to be centered.
animationPointer to the BlobAnimation widget serving as the reference area.
Here is the caller graph for this function:

◆ 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
frequencyThe 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
labelPointer to the QLabel to be styled.
text_colorThe desired color for the label's text.
border_colorThe desired color for the label's border.

The documentation for this class was generated from the following files: