2017-12-05 08:43:18 +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-05 08:43:18 +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-05 08:43:18 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
|
|
|
class EmptyUserpic {
|
|
|
|
public:
|
|
|
|
EmptyUserpic(const style::color &color, const QString &name);
|
|
|
|
|
|
|
|
void paint(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size) const;
|
|
|
|
void paintRounded(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size) const;
|
|
|
|
void paintSquare(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size) const;
|
|
|
|
QPixmap generate(int size);
|
2019-03-22 13:43:34 +00:00
|
|
|
InMemoryKey uniqueKey() const;
|
2017-12-05 08:43:18 +00:00
|
|
|
|
2017-12-05 11:50:32 +00:00
|
|
|
static void PaintSavedMessages(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
2019-08-28 18:20:49 +00:00
|
|
|
static void PaintSavedMessagesRounded(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
2017-12-05 16:48:03 +00:00
|
|
|
static void PaintSavedMessages(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
2019-08-28 18:20:49 +00:00
|
|
|
static void PaintSavedMessagesRounded(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
|
|
|
static QPixmap GenerateSavedMessages(int size);
|
|
|
|
static QPixmap GenerateSavedMessagesRounded(int size);
|
2017-12-05 11:50:32 +00:00
|
|
|
|
2020-09-11 15:33:26 +00:00
|
|
|
static void PaintRepliesMessages(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
|
|
|
static void PaintRepliesMessagesRounded(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size);
|
|
|
|
static void PaintRepliesMessages(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
|
|
|
static void PaintRepliesMessagesRounded(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
const style::color &bg,
|
|
|
|
const style::color &fg);
|
|
|
|
static QPixmap GenerateRepliesMessages(int size);
|
|
|
|
static QPixmap GenerateRepliesMessagesRounded(int size);
|
|
|
|
|
2017-12-05 08:43:18 +00:00
|
|
|
~EmptyUserpic();
|
|
|
|
|
|
|
|
private:
|
|
|
|
template <typename Callback>
|
|
|
|
void paint(
|
|
|
|
Painter &p,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int outerWidth,
|
|
|
|
int size,
|
|
|
|
Callback paintBackground) const;
|
|
|
|
|
|
|
|
void fillString(const QString &name);
|
|
|
|
|
|
|
|
style::color _color;
|
|
|
|
QString _string;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Ui
|