chart_header_widget.h 790 B

123456789101112131415161718192021222324252627282930313233343536
  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/rp_widget.h"
  9. namespace Statistic {
  10. class Header final : public Ui::RpWidget {
  11. public:
  12. explicit Header(not_null<Ui::RpWidget*> parent);
  13. [[nodiscard]] QString title() const;
  14. void setTitle(QString title);
  15. void setSubTitle(QString subTitle);
  16. protected:
  17. void paintEvent(QPaintEvent *e) override;
  18. void resizeEvent(QResizeEvent *e) override;
  19. int resizeGetHeight(int newWidth) override;
  20. private:
  21. Ui::Text::String _title;
  22. Ui::Text::String _subTitle;
  23. int _infoTop = 0;
  24. int _height = 0;
  25. };
  26. } // namespace Statistic