init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
116
Telegram/SourceFiles/dialogs/ui/dialogs_layout.h
Normal file
116
Telegram/SourceFiles/dialogs/ui/dialogs_layout.h
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
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 "dialogs/ui/dialogs_quick_action_context.h"
|
||||
#include "ui/cached_round_corners.h"
|
||||
|
||||
namespace style {
|
||||
struct DialogRow;
|
||||
struct VerifiedBadge;
|
||||
} // namespace style
|
||||
|
||||
namespace st {
|
||||
extern const style::DialogRow &defaultDialogRow;
|
||||
} // namespace st
|
||||
|
||||
namespace Data {
|
||||
class Forum;
|
||||
class Folder;
|
||||
class Thread;
|
||||
} // namespace Data
|
||||
|
||||
namespace Dialogs {
|
||||
class Row;
|
||||
class FakeRow;
|
||||
class BasicRow;
|
||||
struct RightButton;
|
||||
} // namespace Dialogs
|
||||
|
||||
namespace Dialogs::Ui {
|
||||
|
||||
using namespace ::Ui;
|
||||
|
||||
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;
|
||||
TopicJumpCorners selected;
|
||||
TopicJumpCorners rippleMask;
|
||||
};
|
||||
|
||||
struct PaintContext {
|
||||
RightButton *rightButton = nullptr;
|
||||
std::vector<QImage*> *chatsFilterTags = nullptr;
|
||||
QuickActionContext *quickActionContext = nullptr;
|
||||
not_null<const style::DialogRow*> st;
|
||||
TopicJumpCache *topicJumpCache = nullptr;
|
||||
Data::Folder *folder = nullptr;
|
||||
Data::Forum *forum = nullptr;
|
||||
required<QBrush> currentBg;
|
||||
FilterId filter = 0;
|
||||
float64 topicsExpanded = 0.;
|
||||
crl::time now = 0;
|
||||
QStringView searchLowerText;
|
||||
int width = 0;
|
||||
bool active = false;
|
||||
bool selected = false;
|
||||
bool topicJumpSelected = false;
|
||||
bool paused = false;
|
||||
bool search = false;
|
||||
bool narrow = false;
|
||||
bool displayUnreadInfo = false;
|
||||
};
|
||||
|
||||
[[nodiscard]] const style::icon *ChatTypeIcon(
|
||||
not_null<PeerData*> peer,
|
||||
const PaintContext &context);
|
||||
[[nodiscard]] const style::icon *ChatTypeIcon(not_null<PeerData*> peer);
|
||||
|
||||
[[nodiscard]] const style::VerifiedBadge &VerifiedStyle(
|
||||
const PaintContext &context);
|
||||
|
||||
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 Data::Thread*> thread,
|
||||
FilterId filterId,
|
||||
QRect rect,
|
||||
int fullWidth,
|
||||
bool textUpdated);
|
||||
};
|
||||
|
||||
void PaintCollapsedRow(
|
||||
Painter &p,
|
||||
const BasicRow &row,
|
||||
Data::Folder *folder,
|
||||
const QString &text,
|
||||
int unread,
|
||||
const PaintContext &context);
|
||||
|
||||
int PaintRightButton(QPainter &p, const PaintContext &context);
|
||||
|
||||
} // namespace Dialogs::Ui
|
||||
Reference in New Issue
Block a user