Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
cyber_checkbox.h
Go to the documentation of this file.
1#ifndef CYBER_CHECKBOX_H
2#define CYBER_CHECKBOX_H
3
4#include <QCheckBox>
5
14class CyberCheckBox final : public QCheckBox {
15 Q_OBJECT
17 Q_PROPERTY(double glowIntensity READ GetGlowIntensity WRITE SetGlowIntensity)
18
19public:
27 explicit CyberCheckBox(const QString &text, QWidget *parent = nullptr);
28
34 QSize sizeHint() const override;
35
40 double GetGlowIntensity() const { return glow_intensity_; }
41
47 void SetGlowIntensity(double intensity);
48
49protected:
56 void paintEvent(QPaintEvent *event) override;
57
62 void enterEvent(QEvent *event) override;
63
68 void leaveEvent(QEvent *event) override;
69
70private:
73};
74
75#endif //CYBER_CHECKBOX_H
CyberCheckBox(const QString &text, QWidget *parent=nullptr)
Constructs a CyberCheckBox. Initializes the checkbox with text, applies basic styling (spacing,...
Definition cyber_checkbox.cpp:8
void paintEvent(QPaintEvent *event) override
Overridden paint event handler. Draws the custom checkbox appearance. Renders the clipped square indi...
Definition cyber_checkbox.cpp:34
double glow_intensity_
Current intensity of the glow effect. Modified by animations on hover.
Definition cyber_checkbox.h:72
void enterEvent(QEvent *event) override
Overridden enter event handler. Animates the glow intensity to a higher value.
Definition cyber_checkbox.cpp:98
void leaveEvent(QEvent *event) override
Overridden leave event handler. Animates the glow intensity back to its default value.
Definition cyber_checkbox.cpp:107
double GetGlowIntensity() const
Gets the current intensity of the glow effect.
Definition cyber_checkbox.h:40
QSize sizeHint() const override
Returns the recommended size for the checkbox. Ensures a minimum height is respected.
Definition cyber_checkbox.cpp:23
void SetGlowIntensity(double intensity)
Sets the intensity of the glow effect. Triggers a repaint of the checkbox.
Definition cyber_checkbox.cpp:29
double glowIntensity
Property controlling the intensity of the checkbox border glow (0.0 to 1.0+). Animatable.
Definition cyber_checkbox.h:17