2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-23 19:07:25 +00:00

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