Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
mask_overlay_effect.h
Go to the documentation of this file.
1#ifndef MASK_OVERLAY_H
2#define MASK_OVERLAY_H
3
4#include <QWidget>
5
15class MaskOverlayEffect final : public QWidget {
16 Q_OBJECT
17
18public:
25 explicit MaskOverlayEffect(QWidget *parent = nullptr);
26
27public slots:
33 void SetRevealProgress(int percentage);
34
40 void StartScanning();
41
45 void StopScanning();
46
47protected:
55 void paintEvent(QPaintEvent *event) override;
56
57private slots:
63 void UpdateScanLine();
64
65private:
71 QTimer *scan_timer_;
72};
73
74#endif // MASK_OVERLAY_H
int scanline_y_
The current vertical position (y-coordinate) of the scanline.
Definition mask_overlay_effect.h:69
void UpdateScanLine()
Slot called by the scan_timer_ to update the vertical position of the scanline. Moves the scanline do...
Definition mask_overlay_effect.cpp:90
void SetRevealProgress(int percentage)
Sets the vertical reveal progress as a percentage. Controls how much of the underlying widget is reve...
Definition mask_overlay_effect.cpp:16
void paintEvent(QPaintEvent *event) override
Overridden paint event handler. Draws the overlay's appearance. Renders the semi-transparent mask ove...
Definition mask_overlay_effect.cpp:36
void StopScanning()
Stops the scanline animation and hides the overlay.
Definition mask_overlay_effect.cpp:31
int reveal_percentage_
The current reveal progress percentage (0-100). Determines the height of the revealed area.
Definition mask_overlay_effect.h:67
MaskOverlayEffect(QWidget *parent=nullptr)
Constructs a MaskOverlay widget. Initializes the widget attributes (transparent for mouse events,...
Definition mask_overlay_effect.cpp:7
void StartScanning()
Starts or restarts the scanline animation and reveal effect. Resets the reveal percentage and scanlin...
Definition mask_overlay_effect.cpp:21
QTimer * scan_timer_
Timer controlling the animation of the scanline's movement.
Definition mask_overlay_effect.h:71