ZaStoGram_desktop/Telegram/SourceFiles/ui/chat/unsupported_notice.h
John Preston 1926d9bfa1 Show update notices for unsupported messages and blocks
Task: 2026/08/08/present-unsupported-messages-and-blocks
2026-08-10 21:24:40 +04:00

51 lines
1,003 B
C++

/*
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/text/text.h"
class Painter;
namespace Ui {
class RippleAnimation;
struct ChatPaintContext;
class UnsupportedNoticeCard final {
public:
void setTexts(
const QString &title,
const QString &text,
const QString &button);
int resizeGetHeight(int availableWidth);
void paint(
Painter &p,
const ChatPaintContext &context,
QRect cardRect,
RippleAnimation *ripple) const;
[[nodiscard]] int width() const;
[[nodiscard]] int height() const;
[[nodiscard]] QRect buttonRect() const;
[[nodiscard]] QSize buttonSize() const;
private:
Text::String _title;
Text::String _text;
Text::String _button;
QSize _buttonSize;
int _width = 0;
int _height = 0;
int _columnWidth = 0;
int _textLines = 1;
};
} // namespace Ui