tdesktop/Telegram/SourceFiles/ui/unread_badge.h

51 lines
1002 B
C
Raw Normal View History

2017-12-17 11:04:47 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2017-12-17 11:04:47 +00:00
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
2017-12-17 11:04:47 +00:00
*/
#pragma once
#include "ui/rp_widget.h"
namespace Ui {
class UnreadBadge : public RpWidget {
public:
using RpWidget::RpWidget;
void setText(const QString &text, bool active);
2019-05-26 12:08:34 +00:00
int textBaseline() const;
2017-12-17 11:04:47 +00:00
protected:
void paintEvent(QPaintEvent *e) override;
private:
QString _text;
bool _active = false;
};
2019-06-23 12:18:33 +00:00
struct PeerBadgeStyle {
const style::icon *verified = nullptr;
2022-05-20 15:28:50 +00:00
const style::icon *premium = nullptr;
2019-06-23 12:18:33 +00:00
const style::color *scam = nullptr;
};
int DrawPeerBadgeGetWidth(
not_null<PeerData*> peer,
Painter &p,
QRect rectForName,
int nameWidth,
int outerWidth,
const PeerBadgeStyle &st);
2021-01-21 12:39:40 +00:00
QSize ScamBadgeSize(bool fake);
2019-06-23 12:18:33 +00:00
void DrawScamBadge(
2021-01-21 12:39:40 +00:00
bool fake,
2019-06-23 12:18:33 +00:00
Painter &p,
QRect rect,
int outerWidth,
const style::color &color);
2017-12-17 11:04:47 +00:00
} // namespace Ui