gradient_round_button.h 718 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "ui/widgets/buttons.h"
  9. #include "ui/effects/glare.h"
  10. namespace Ui {
  11. class GradientButton final : public Ui::RippleButton {
  12. public:
  13. GradientButton(QWidget *widget, QGradientStops stops);
  14. void startGlareAnimation();
  15. void setGlarePaused(bool paused);
  16. private:
  17. void paintEvent(QPaintEvent *e);
  18. void paintGlare(QPainter &p);
  19. void validateBg();
  20. void validateGlare();
  21. QGradientStops _stops;
  22. QImage _bg;
  23. GlareEffect _glare;
  24. };
  25. } // namespace Ui