2016-04-09 18:45:55 +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.
|
2016-04-09 18:45:55 +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
|
2016-04-09 18:45:55 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Dialogs {
|
|
|
|
|
|
|
|
class Row;
|
|
|
|
class FakeRow;
|
2019-05-03 10:55:44 +00:00
|
|
|
class RippleRow;
|
2016-04-09 18:45:55 +00:00
|
|
|
|
|
|
|
namespace Layout {
|
|
|
|
|
2017-11-05 11:21:30 +00:00
|
|
|
const style::icon *ChatTypeIcon(
|
2018-02-22 13:50:56 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
bool active,
|
|
|
|
bool selected);
|
2019-04-15 11:54:03 +00:00
|
|
|
//const style::icon *FeedTypeIcon( // #feed
|
|
|
|
// not_null<Data::Feed*> feed,
|
|
|
|
// bool active,
|
|
|
|
// bool selected);
|
2016-09-30 12:52:03 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
class RowPainter {
|
|
|
|
public:
|
2017-11-05 11:21:30 +00:00
|
|
|
static void paint(
|
|
|
|
Painter &p,
|
2018-01-05 15:57:18 +00:00
|
|
|
not_null<const Row*> row,
|
2017-11-05 11:21:30 +00:00
|
|
|
int fullWidth,
|
|
|
|
bool active,
|
|
|
|
bool selected,
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time ms);
|
2017-11-05 11:21:30 +00:00
|
|
|
static void paint(
|
|
|
|
Painter &p,
|
2018-01-05 15:57:18 +00:00
|
|
|
not_null<const FakeRow*> row,
|
2017-11-05 11:21:30 +00:00
|
|
|
int fullWidth,
|
|
|
|
bool active,
|
|
|
|
bool selected,
|
2019-02-19 06:57:53 +00:00
|
|
|
crl::time ms,
|
2018-10-09 15:36:06 +00:00
|
|
|
bool displayUnreadInfo);
|
2017-11-05 11:21:30 +00:00
|
|
|
static QRect sendActionAnimationRect(
|
|
|
|
int animationWidth,
|
|
|
|
int animationHeight,
|
|
|
|
int fullWidth,
|
|
|
|
bool textUpdated);
|
2016-12-05 08:45:56 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
};
|
|
|
|
|
2019-05-03 10:55:44 +00:00
|
|
|
void PaintCollapsedRow(
|
2017-11-05 11:21:30 +00:00
|
|
|
Painter &p,
|
2019-05-03 10:55:44 +00:00
|
|
|
const RippleRow &row,
|
2019-05-03 13:02:00 +00:00
|
|
|
Data::Folder *folder,
|
2019-05-03 10:55:44 +00:00
|
|
|
const QString &text,
|
|
|
|
int unread,
|
2017-11-05 11:21:30 +00:00
|
|
|
int fullWidth,
|
2019-04-16 09:29:21 +00:00
|
|
|
bool selected);
|
2016-04-11 10:59:01 +00:00
|
|
|
|
2016-06-21 15:58:07 +00:00
|
|
|
enum UnreadBadgeSize {
|
|
|
|
UnreadBadgeInDialogs = 0,
|
|
|
|
UnreadBadgeInHistoryToDown,
|
2016-06-28 18:05:38 +00:00
|
|
|
UnreadBadgeInStickersPanel,
|
|
|
|
UnreadBadgeInStickersBox,
|
2016-06-21 15:58:07 +00:00
|
|
|
|
|
|
|
UnreadBadgeSizesCount
|
|
|
|
};
|
|
|
|
struct UnreadBadgeStyle {
|
|
|
|
UnreadBadgeStyle();
|
|
|
|
|
|
|
|
style::align align;
|
|
|
|
bool active;
|
2016-11-07 11:24:19 +00:00
|
|
|
bool selected;
|
2016-06-21 15:58:07 +00:00
|
|
|
bool muted;
|
2016-11-22 09:48:13 +00:00
|
|
|
int textTop = 0;
|
2016-06-21 15:58:07 +00:00
|
|
|
int size;
|
2016-11-22 09:48:13 +00:00
|
|
|
int padding;
|
2016-06-21 15:58:07 +00:00
|
|
|
UnreadBadgeSize sizeId;
|
|
|
|
style::font font;
|
|
|
|
};
|
2017-11-05 11:21:30 +00:00
|
|
|
void paintUnreadCount(
|
|
|
|
Painter &p,
|
2019-05-22 08:57:25 +00:00
|
|
|
const QString &t,
|
2017-11-05 11:21:30 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
const UnreadBadgeStyle &st,
|
2019-05-22 08:57:25 +00:00
|
|
|
int *outUnreadWidth = nullptr,
|
|
|
|
int allowDigits = 0);
|
2016-06-03 12:45:33 +00:00
|
|
|
|
2016-12-31 13:34:41 +00:00
|
|
|
void clearUnreadBadgesCache();
|
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
} // namespace Layout
|
|
|
|
} // namespace Dialogs
|