2016-04-09 22:45:55 +04:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 13:23:14 +03:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-04-09 22:45:55 +04:00
|
|
|
|
2018-01-03 13:23:14 +03:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-04-09 22:45:55 +04:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Dialogs {
|
|
|
|
|
|
|
|
class Row;
|
|
|
|
class FakeRow;
|
|
|
|
|
|
|
|
namespace Layout {
|
|
|
|
|
2017-11-05 15:21:30 +04:00
|
|
|
const style::icon *ChatTypeIcon(
|
|
|
|
PeerData *peer,
|
|
|
|
bool active,
|
|
|
|
bool selected);
|
2016-09-30 15:52:03 +03:00
|
|
|
|
2016-04-09 22:45:55 +04:00
|
|
|
class RowPainter {
|
|
|
|
public:
|
2017-11-05 15:21:30 +04:00
|
|
|
static void paint(
|
|
|
|
Painter &p,
|
2018-01-05 18:57:18 +03:00
|
|
|
not_null<const Row*> row,
|
2017-11-05 15:21:30 +04:00
|
|
|
int fullWidth,
|
|
|
|
bool active,
|
|
|
|
bool selected,
|
|
|
|
bool onlyBackground,
|
|
|
|
TimeMs ms);
|
|
|
|
static void paint(
|
|
|
|
Painter &p,
|
2018-01-05 18:57:18 +03:00
|
|
|
not_null<const FakeRow*> row,
|
2017-11-05 15:21:30 +04:00
|
|
|
int fullWidth,
|
|
|
|
bool active,
|
|
|
|
bool selected,
|
|
|
|
bool onlyBackground,
|
|
|
|
TimeMs ms);
|
|
|
|
static QRect sendActionAnimationRect(
|
|
|
|
int animationWidth,
|
|
|
|
int animationHeight,
|
|
|
|
int fullWidth,
|
|
|
|
bool textUpdated);
|
2016-12-05 11:45:56 +03:00
|
|
|
|
2016-04-09 22:45:55 +04:00
|
|
|
};
|
|
|
|
|
2017-11-05 15:21:30 +04:00
|
|
|
void paintImportantSwitch(
|
|
|
|
Painter &p,
|
|
|
|
Mode current,
|
|
|
|
int fullWidth,
|
|
|
|
bool selected,
|
|
|
|
bool onlyBackground);
|
2016-04-11 14:59:01 +04:00
|
|
|
|
2016-06-21 18:58:07 +03:00
|
|
|
enum UnreadBadgeSize {
|
|
|
|
UnreadBadgeInDialogs = 0,
|
|
|
|
UnreadBadgeInHistoryToDown,
|
2016-06-28 21:05:38 +03:00
|
|
|
UnreadBadgeInStickersPanel,
|
|
|
|
UnreadBadgeInStickersBox,
|
2016-06-21 18:58:07 +03:00
|
|
|
|
|
|
|
UnreadBadgeSizesCount
|
|
|
|
};
|
|
|
|
struct UnreadBadgeStyle {
|
|
|
|
UnreadBadgeStyle();
|
|
|
|
|
|
|
|
style::align align;
|
|
|
|
bool active;
|
2016-11-07 14:24:19 +03:00
|
|
|
bool selected;
|
2016-06-21 18:58:07 +03:00
|
|
|
bool muted;
|
2016-11-22 12:48:13 +03:00
|
|
|
int textTop = 0;
|
2016-06-21 18:58:07 +03:00
|
|
|
int size;
|
2016-11-22 12:48:13 +03:00
|
|
|
int padding;
|
2016-06-21 18:58:07 +03:00
|
|
|
UnreadBadgeSize sizeId;
|
|
|
|
style::font font;
|
|
|
|
};
|
2017-11-05 15:21:30 +04:00
|
|
|
void paintUnreadCount(
|
|
|
|
Painter &p,
|
|
|
|
const QString &text,
|
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
const UnreadBadgeStyle &st,
|
|
|
|
int *outUnreadWidth = nullptr);
|
2016-06-03 15:45:33 +03:00
|
|
|
|
2016-12-31 17:34:41 +04:00
|
|
|
void clearUnreadBadgesCache();
|
|
|
|
|
2016-04-09 22:45:55 +04:00
|
|
|
} // namespace Layout
|
|
|
|
} // namespace Dialogs
|