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

A custom QSlider styled with a cyberpunk aesthetic, specifically themed for audio controls. More...

#include <cyber_audio_slider.h>

Inheritance diagram for CyberAudioSlider:
Collaboration diagram for CyberAudioSlider:

Public Member Functions

 CyberAudioSlider (Qt::Orientation orientation, QWidget *parent=nullptr)
 Constructs a CyberAudioSlider. Initializes the slider with the specified orientation and applies basic styling (transparent background, no border) via stylesheet. Sets the initial glow intensity.
 
double GetGlowIntensity () const
 Gets the current intensity of the glow effect.
 
void SetGlowIntensity (double intensity)
 Sets the intensity of the glow effect. Triggers a repaint of the slider.
 

Protected Member Functions

void enterEvent (QEvent *event) override
 Overridden enter event handler. Animates the glow effect intensity increase on mouse hover.
 
void leaveEvent (QEvent *event) override
 Overridden leave event handler. Animates the glow effect intensity decrease when the mouse leaves.
 
void paintEvent (QPaintEvent *event) override
 Overridden paint event handler. Draws the custom slider appearance. Renders the track, the progress bar (filled portion), the handle, and the glow effect using cyberpunk-themed purple/blue colors. Includes decorative lines on the progress bar and handle.
 

Properties

double glowIntensity
 Property controlling the intensity of the handle's glow effect (0.0 to 1.0). Animatable.
 

Private Attributes

double glow_intensity_
 Current intensity of the glow effect. Modified by animations on hover.
 

Detailed Description

A custom QSlider styled with a cyberpunk aesthetic, specifically themed for audio controls.

This slider features a dark purple track, a neon-purple progress bar, and a handle with a subtle glow effect that animates on hover. It's designed visually to represent audio volume or similar audio-related settings.

Constructor & Destructor Documentation

◆ CyberAudioSlider()

CyberAudioSlider::CyberAudioSlider ( Qt::Orientation orientation,
QWidget * parent = nullptr )
explicit

Constructs a CyberAudioSlider. Initializes the slider with the specified orientation and applies basic styling (transparent background, no border) via stylesheet. Sets the initial glow intensity.

Parameters
orientationThe orientation of the slider (Horizontal or Vertical).
parentOptional parent widget.

Member Function Documentation

◆ enterEvent()

void CyberAudioSlider::enterEvent ( QEvent * event)
overrideprotected

Overridden enter event handler. Animates the glow effect intensity increase on mouse hover.

Parameters
eventThe enter event.

◆ GetGlowIntensity()

double CyberAudioSlider::GetGlowIntensity ( ) const
inline

Gets the current intensity of the glow effect.

Returns
The glow intensity value (typically 0.0 to 1.0).

◆ leaveEvent()

void CyberAudioSlider::leaveEvent ( QEvent * event)
overrideprotected

Overridden leave event handler. Animates the glow effect intensity decrease when the mouse leaves.

Parameters
eventThe leave event.

◆ paintEvent()

void CyberAudioSlider::paintEvent ( QPaintEvent * event)
overrideprotected

Overridden paint event handler. Draws the custom slider appearance. Renders the track, the progress bar (filled portion), the handle, and the glow effect using cyberpunk-themed purple/blue colors. Includes decorative lines on the progress bar and handle.

Parameters
eventThe paint event.

◆ SetGlowIntensity()

void CyberAudioSlider::SetGlowIntensity ( double intensity)

Sets the intensity of the glow effect. Triggers a repaint of the slider.

Parameters
intensityThe desired glow intensity.

Member Data Documentation

◆ glow_intensity_

double CyberAudioSlider::glow_intensity_
private

Current intensity of the glow effect. Modified by animations on hover.

Property Documentation

◆ glowIntensity

double CyberAudioSlider::glowIntensity
readwrite

Property controlling the intensity of the handle's glow effect (0.0 to 1.0). Animatable.


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