2016-04-09 18:45:55 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
2017-01-11 18:31:31 +00:00
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
2016-04-09 18:45:55 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Dialogs {
|
|
|
|
|
|
|
|
class Row;
|
|
|
|
class FakeRow;
|
|
|
|
|
|
|
|
namespace Layout {
|
|
|
|
|
2016-11-05 08:36:24 +00:00
|
|
|
const style::icon *ChatTypeIcon(PeerData *peer, bool active, bool selected);
|
2016-09-30 12:52:03 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
class RowPainter {
|
|
|
|
public:
|
2016-12-05 11:01:08 +00:00
|
|
|
static void paint(Painter &p, const Row *row, int fullWidth, bool active, bool selected, bool onlyBackground, TimeMs ms);
|
|
|
|
static void paint(Painter &p, const FakeRow *row, int fullWidth, bool active, bool selected, bool onlyBackground, TimeMs ms);
|
2016-12-05 08:45:56 +00:00
|
|
|
static QRect sendActionAnimationRect(int animationWidth, int animationHeight, int fullWidth, bool textUpdated);
|
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
};
|
|
|
|
|
2016-12-05 11:01:08 +00:00
|
|
|
void paintImportantSwitch(Painter &p, Mode current, int fullWidth, bool selected, bool onlyBackground);
|
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;
|
|
|
|
};
|
|
|
|
void paintUnreadCount(Painter &p, const QString &text, int x, int y, const UnreadBadgeStyle &st, int *outUnreadWidth = nullptr);
|
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
|