2022-05-19 00:30:46 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui/widgets/buttons.h"
|
2022-10-11 13:13:20 +00:00
|
|
|
#include "ui/effects/glare.h"
|
2022-05-19 00:30:46 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
|
|
|
class GradientButton final : public Ui::RippleButton {
|
|
|
|
public:
|
|
|
|
GradientButton(QWidget *widget, QGradientStops stops);
|
|
|
|
|
2022-06-12 05:23:23 +00:00
|
|
|
void startGlareAnimation();
|
2022-06-14 09:42:43 +00:00
|
|
|
void setGlarePaused(bool paused);
|
2022-06-12 05:23:23 +00:00
|
|
|
|
2022-05-19 00:30:46 +00:00
|
|
|
private:
|
|
|
|
void paintEvent(QPaintEvent *e);
|
2022-06-12 05:23:23 +00:00
|
|
|
void paintGlare(QPainter &p);
|
2022-05-19 00:30:46 +00:00
|
|
|
void validateBg();
|
2022-06-12 05:23:23 +00:00
|
|
|
void validateGlare();
|
|
|
|
|
2022-05-19 00:30:46 +00:00
|
|
|
QGradientStops _stops;
|
|
|
|
QImage _bg;
|
|
|
|
|
2022-10-11 13:13:20 +00:00
|
|
|
GlareEffect _glare;
|
2022-06-12 05:23:23 +00:00
|
|
|
|
2022-05-19 00:30:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Ui
|