forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogs_layout.h
96 lines (82 loc) · 1.69 KB
/
dialogs_layout.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
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
namespace Data {
class Feed;
} // namespace Data
namespace Dialogs {
class Row;
class FakeRow;
namespace Layout {
const style::icon *ChatTypeIcon(
not_null<PeerData*> peer,
bool active,
bool selected);
const style::icon *FeedTypeIcon(
not_null<Data::Feed*> feed,
bool active,
bool selected);
class RowPainter {
public:
static void paint(
Painter &p,
not_null<const Row*> row,
int fullWidth,
bool active,
bool selected,
bool onlyBackground,
TimeMs ms);
static void paint(
Painter &p,
not_null<const FakeRow*> row,
int fullWidth,
bool active,
bool selected,
bool onlyBackground,
TimeMs ms,
bool displayUnreadInfo);
static QRect sendActionAnimationRect(
int animationWidth,
int animationHeight,
int fullWidth,
bool textUpdated);
};
void paintImportantSwitch(
Painter &p,
Mode current,
int fullWidth,
bool selected,
bool onlyBackground);
enum UnreadBadgeSize {
UnreadBadgeInDialogs = 0,
UnreadBadgeInHistoryToDown,
UnreadBadgeInStickersPanel,
UnreadBadgeInStickersBox,
UnreadBadgeSizesCount
};
struct UnreadBadgeStyle {
UnreadBadgeStyle();
style::align align;
bool active;
bool selected;
bool muted;
int textTop = 0;
int size;
int padding;
UnreadBadgeSize sizeId;
style::font font;
};
void paintUnreadCount(
Painter &p,
const QString &text,
int x,
int y,
const UnreadBadgeStyle &st,
int *outUnreadWidth = nullptr);
void clearUnreadBadgesCache();
} // namespace Layout
} // namespace Dialogs