tdesktop/Telegram/SourceFiles/dialogs/dialogs_layout.h

97 lines
1.8 KiB
C
Raw Normal View History

/*
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 Dialogs {
class Row;
class FakeRow;
2019-06-17 14:37:29 +00:00
class BasicRow;
namespace Layout {
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);
class RowPainter {
public:
static void paint(
Painter &p,
not_null<const Row*> row,
2020-03-17 13:04:30 +00:00
FilterId filterId,
int fullWidth,
bool active,
bool selected,
crl::time ms);
static void paint(
Painter &p,
not_null<const FakeRow*> row,
int fullWidth,
bool active,
bool selected,
crl::time ms,
bool displayUnreadInfo);
static QRect sendActionAnimationRect(
int animationWidth,
int animationHeight,
int fullWidth,
bool textUpdated);
};
void PaintCollapsedRow(
Painter &p,
2019-06-17 14:37:29 +00:00
const BasicRow &row,
Data::Folder *folder,
const QString &text,
int unread,
int fullWidth,
bool selected);
enum UnreadBadgeSize {
UnreadBadgeInDialogs = 0,
UnreadBadgeInHistoryToDown,
UnreadBadgeInStickersPanel,
UnreadBadgeInStickersBox,
2019-05-27 17:55:53 +00:00
UnreadBadgeInTouchBar,
UnreadBadgeSizesCount
};
struct UnreadBadgeStyle {
UnreadBadgeStyle();
style::align align = style::al_right;
bool active = false;
bool selected = false;
bool muted = false;
2016-11-22 09:48:13 +00:00
int textTop = 0;
int size = 0;
int padding = 0;
UnreadBadgeSize sizeId = UnreadBadgeInDialogs;
style::font font;
};
void paintUnreadCount(
Painter &p,
const QString &t,
int x,
int y,
const UnreadBadgeStyle &st,
int *outUnreadWidth = nullptr,
int allowDigits = 0);
void clearUnreadBadgesCache();
} // namespace Layout
} // namespace Dialogs