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
|
|
|
|
|
2022-11-13 19:38:18 +00:00
|
|
|
#include "ui/cached_round_corners.h"
|
|
|
|
|
2022-09-29 10:33:17 +00:00
|
|
|
namespace style {
|
|
|
|
struct DialogRow;
|
|
|
|
} // namespace style
|
|
|
|
|
|
|
|
namespace st {
|
|
|
|
extern const style::DialogRow &defaultDialogRow;
|
|
|
|
} // namespace st
|
|
|
|
|
2021-10-01 10:57:24 +00:00
|
|
|
namespace Ui {
|
|
|
|
} // namespace Ui
|
2016-04-09 18:45:55 +00:00
|
|
|
|
2022-09-29 07:52:18 +00:00
|
|
|
namespace Data {
|
|
|
|
class Forum;
|
|
|
|
class Folder;
|
|
|
|
} // namespace Data
|
|
|
|
|
2021-10-01 10:57:24 +00:00
|
|
|
namespace Dialogs {
|
2016-04-09 18:45:55 +00:00
|
|
|
class Row;
|
|
|
|
class FakeRow;
|
2019-06-17 14:37:29 +00:00
|
|
|
class BasicRow;
|
2021-10-01 10:57:24 +00:00
|
|
|
} // namespace Dialogs
|
2016-04-09 18:45:55 +00:00
|
|
|
|
2021-10-01 10:57:24 +00:00
|
|
|
namespace Dialogs::Ui {
|
|
|
|
|
|
|
|
using namespace ::Ui;
|
2016-04-09 18:45:55 +00:00
|
|
|
|
2022-08-09 11:12:19 +00:00
|
|
|
class VideoUserpic;
|
|
|
|
|
2022-11-13 19:38:18 +00:00
|
|
|
struct TopicJumpCorners {
|
2022-12-05 12:18:10 +00:00
|
|
|
CornersPixmaps normal;
|
|
|
|
CornersPixmaps inverted;
|
2022-11-13 19:38:18 +00:00
|
|
|
QPixmap small;
|
|
|
|
int invertedRadius = 0;
|
|
|
|
int smallKey = 0; // = `-radius` if top right else `radius`.
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TopicJumpCache {
|
|
|
|
TopicJumpCorners corners;
|
|
|
|
TopicJumpCorners over;
|
2022-11-14 07:24:31 +00:00
|
|
|
TopicJumpCorners selected;
|
2022-11-13 19:38:18 +00:00
|
|
|
TopicJumpCorners rippleMask;
|
|
|
|
};
|
|
|
|
|
2022-09-29 07:52:18 +00:00
|
|
|
struct PaintContext {
|
2022-09-29 10:33:17 +00:00
|
|
|
not_null<const style::DialogRow*> st;
|
2022-11-13 19:38:18 +00:00
|
|
|
TopicJumpCache *topicJumpCache = nullptr;
|
2022-09-29 07:52:18 +00:00
|
|
|
Data::Folder *folder = nullptr;
|
|
|
|
Data::Forum *forum = nullptr;
|
2022-12-06 16:32:58 +00:00
|
|
|
required<QBrush> currentBg;
|
2022-09-29 07:52:18 +00:00
|
|
|
FilterId filter = 0;
|
2022-12-01 13:48:33 +00:00
|
|
|
float64 topicsExpanded = 0.;
|
2022-09-29 07:52:18 +00:00
|
|
|
crl::time now = 0;
|
|
|
|
int width = 0;
|
|
|
|
bool active = false;
|
|
|
|
bool selected = false;
|
2022-11-14 07:24:31 +00:00
|
|
|
bool topicJumpSelected = false;
|
2022-09-29 07:52:18 +00:00
|
|
|
bool paused = false;
|
|
|
|
bool search = false;
|
|
|
|
bool narrow = false;
|
|
|
|
bool displayUnreadInfo = false;
|
|
|
|
};
|
|
|
|
|
2022-12-06 16:32:58 +00:00
|
|
|
[[nodiscard]] const style::icon *ChatTypeIcon(
|
2018-02-22 13:50:56 +00:00
|
|
|
not_null<PeerData*> peer,
|
2022-12-06 16:32:58 +00:00
|
|
|
const PaintContext &context);
|
|
|
|
[[nodiscard]] const style::icon *ChatTypeIcon(not_null<PeerData*> peer);
|
2016-09-30 12:52:03 +00:00
|
|
|
|
2016-04-09 18:45:55 +00:00
|
|
|
class RowPainter {
|
|
|
|
public:
|
2022-09-29 07:52:18 +00:00
|
|
|
static void Paint(
|
2017-11-05 11:21:30 +00:00
|
|
|
Painter &p,
|
2018-01-05 15:57:18 +00:00
|
|
|
not_null<const Row*> row,
|
2022-05-16 11:38:35 +00:00
|
|
|
VideoUserpic *videoUserpic,
|
2022-09-29 07:52:18 +00:00
|
|
|
const PaintContext &context);
|
|
|
|
static void Paint(
|
2017-11-05 11:21:30 +00:00
|
|
|
Painter &p,
|
2018-01-05 15:57:18 +00:00
|
|
|
not_null<const FakeRow*> row,
|
2022-09-29 07:52:18 +00:00
|
|
|
const PaintContext &context);
|
|
|
|
static QRect SendActionAnimationRect(
|
2022-09-29 10:33:17 +00:00
|
|
|
not_null<const style::DialogRow*> st,
|
2021-08-30 17:38:11 +00:00
|
|
|
int animationLeft,
|
2017-11-05 11:21:30 +00:00
|
|
|
int animationWidth,
|
|
|
|
int animationHeight,
|
|
|
|
int fullWidth,
|
|
|
|
bool textUpdated);
|
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-06-17 14:37:29 +00:00
|
|
|
const BasicRow &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,
|
2022-09-29 10:33:17 +00:00
|
|
|
const PaintContext &context);
|
2016-04-11 10:59:01 +00:00
|
|
|
|
2021-10-01 10:57:24 +00:00
|
|
|
} // namespace Dialogs::Ui
|