2017-12-17 11:04:47 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-12-17 11:04:47 +00:00
|
|
|
|
2018-01-03 10:23:14 +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;
|
|
|
|
const style::color *scam = nullptr;
|
|
|
|
};
|
|
|
|
int DrawPeerBadgeGetWidth(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
Painter &p,
|
|
|
|
QRect rectForName,
|
|
|
|
int nameWidth,
|
|
|
|
int outerWidth,
|
|
|
|
const PeerBadgeStyle &st);
|
|
|
|
QSize ScamBadgeSize();
|
|
|
|
void DrawScamBadge(
|
|
|
|
Painter &p,
|
|
|
|
QRect rect,
|
|
|
|
int outerWidth,
|
|
|
|
const style::color &color);
|
|
|
|
|
2017-12-17 11:04:47 +00:00
|
|
|
} // namespace Ui
|