Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
user_info_label.h
Go to the documentation of this file.
1#ifndef USER_INFO_LABEL_H
2#define USER_INFO_LABEL_H
3
4#include <QLabel>
5
14class UserInfoLabel final : public QLabel {
15 Q_OBJECT
16
17public:
24 explicit UserInfoLabel(QWidget *parent = nullptr);
25
31 void SetShapeColor(const QColor &color);
32
39 QSize sizeHint() const override;
40
46 QSize minimumSizeHint() const override;
47
48protected:
55 void paintEvent(QPaintEvent *event) override;
56
57private:
72};
73
74#endif // USER_INFO_LABEL_H
QSize minimumSizeHint() const override
Returns the minimum recommended size for the label. Similar to sizeHint, but based on the minimum tex...
Definition user_info_label.cpp:27
void SetShapeColor(const QColor &color)
Sets the color of the circle and its glow. Triggers a repaint of the label.
Definition user_info_label.cpp:15
int shape_padding_
Horizontal padding between the right edge of the glow and the start of the text.
Definition user_info_label.h:69
int circle_diameter_
Diameter of the main colored circle indicator.
Definition user_info_label.h:61
qreal glow_spread_
How much each glow layer expands outwards relatively to the previous one.
Definition user_info_label.h:67
qreal pen_width_
The thickness of the pen used to draw the main circle.
Definition user_info_label.h:63
QColor shape_color_
The base color used for the circle and its glow.
Definition user_info_label.h:59
QSize sizeHint() const override
Returns the recommended size for the label. Calculates the size based on the text size plus the space...
Definition user_info_label.cpp:20
int glow_layers_
Number of layers used to render the glow effect.
Definition user_info_label.h:65
int total_shape_size_
Pre-calculated total width required for the circle and its maximum glow extent.
Definition user_info_label.h:71
void paintEvent(QPaintEvent *event) override
Overridden paint event handler. Draws the custom label appearance. Renders the background,...
Definition user_info_label.cpp:34
UserInfoLabel(QWidget *parent=nullptr)
Constructs a UserInfoLabel. Initializes default parameters for the circle and glow effect (diameter,...
Definition user_info_label.cpp:6