Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
animated_dialog.h
Go to the documentation of this file.
1#ifndef ANIMATED_DIALOG_H
2#define ANIMATED_DIALOG_H
3
4#include <QDialog>
5
6class OverlayWidget;
7
16class AnimatedDialog : public QDialog {
17 Q_OBJECT
18
19public:
28
29 Q_ENUM(AnimationType)
30
31
37 explicit AnimatedDialog(QWidget *parent = nullptr, AnimationType type = kSlideFromBottom);
38
42 ~AnimatedDialog() override;
43
48 void SetAnimationDuration(const int duration) { duration_ = duration; }
49
54 int GetAnimationDuration() const { return duration_; }
55
56signals:
61
62protected:
68 void showEvent(QShowEvent *event) override;
69
76 void closeEvent(QCloseEvent *event) override;
77
82
83private:
89 void AnimateShow();
90
95 void AnimateClose();
96
105};
106
107#endif // ANIMATED_DIALOG_H
AnimationType animation_type_
The type of animation selected for this dialog instance.
Definition animated_dialog.h:98
void AnimateShow()
Initiates and runs the animation sequence for showing the dialog based on animation_type_....
Definition animated_dialog.cpp:87
void SetAnimationDuration(const int duration)
Sets the duration for the show and close animations.
Definition animated_dialog.h:48
AnimatedDialog(QWidget *parent=nullptr, AnimationType type=kSlideFromBottom)
Constructs an AnimatedDialog. Sets necessary window flags and attributes for transparency and animati...
Definition animated_dialog.cpp:14
void closeEvent(QCloseEvent *event) override
Overridden close event handler. Prevents immediate closing, starts the close animation (AnimateClose)...
Definition animated_dialog.cpp:58
int duration_
Duration of the show/close animations in milliseconds.
Definition animated_dialog.h:100
double corner_glow_progress_
Progress property (0.0 to 1.0) potentially for corner glow effects. Animatable.
Definition animated_dialog.h:81
void AnimateClose()
Initiates and runs the animation sequence for closing the dialog based on animation_type_....
Definition animated_dialog.cpp:174
OverlayWidget * overlay_
Pointer to the semi-transparent overlay widget displayed behind the dialog during animation.
Definition animated_dialog.h:104
~AnimatedDialog() override
Destructor. Ensures the overlay widget is cleaned up.
Definition animated_dialog.cpp:24
AnimationType
Enum defining the available animation styles for showing and closing the dialog.
Definition animated_dialog.h:23
@ kSlideFromBottom
Dialog slides in from the bottom and out to the bottom.
Definition animated_dialog.h:24
@ kDigitalMaterialization
Dialog slides in, fades in, and then applies a digital materialization effect (requires specific dial...
Definition animated_dialog.h:25
int GetAnimationDuration() const
Gets the current duration for the show and close animations.
Definition animated_dialog.h:54
void showEvent(QShowEvent *event) override
Overridden show event handler. Creates and shows the overlay widget (if applicable),...
Definition animated_dialog.cpp:30
void showAnimationFinished()
Emitted when the show animation (AnimateShow) has finished.
double digitalization_progress_
Progress property (0.0 to 1.0) for the digital materialization effect. Animatable.
Definition animated_dialog.h:79
bool closing_
Flag to prevent recursive calls during the animated closing process.
Definition animated_dialog.h:102
A semi-transparent overlay widget used to dim the background content.
Definition overlay_widget.h:14