Show myself as "My Notes" in Saved Messages sublists.

This commit is contained in:
John Preston
2024-01-01 09:23:57 +04:00
parent fbc600a978
commit bfe7683cdb
15 changed files with 99 additions and 11 deletions
+57 -2
View File
@@ -167,6 +167,22 @@ void PaintHiddenAuthorInner(
fg);
}
void PaintMyNotesInner(
QPainter &p,
int x,
int y,
int size,
const style::color &fg) {
PaintIconInner(
p,
x,
y,
size,
st::defaultDialogRow.photoSize,
st::dialogsMyNotesUserpic,
fg);
}
void PaintExternalMessagesInner(
QPainter &p,
int x,
@@ -421,8 +437,8 @@ void EmptyUserpic::PaintHiddenAuthor(
int size) {
auto bg = QLinearGradient(x, y, x, y + size);
bg.setStops({
{ 0., st::historyPeerSavedMessagesBg->c },
{ 1., st::historyPeerSavedMessagesBg2->c }
{ 0., st::premiumButtonBg2->c },
{ 1., st::premiumButtonBg3->c },
});
const auto &fg = st::historyPeerUserpicFg;
PaintHiddenAuthor(p, x, y, outerWidth, size, QBrush(bg), fg);
@@ -452,6 +468,45 @@ QImage EmptyUserpic::GenerateHiddenAuthor(int size) {
});
}
void EmptyUserpic::PaintMyNotes(
QPainter &p,
int x,
int y,
int outerWidth,
int size) {
auto bg = QLinearGradient(x, y, x, y + size);
bg.setStops({
{ 0., st::historyPeerSavedMessagesBg->c },
{ 1., st::historyPeerSavedMessagesBg2->c }
});
const auto &fg = st::historyPeerUserpicFg;
PaintMyNotes(p, x, y, outerWidth, size, QBrush(bg), fg);
}
void EmptyUserpic::PaintMyNotes(
QPainter &p,
int x,
int y,
int outerWidth,
int size,
QBrush bg,
const style::color &fg) {
x = style::RightToLeft() ? (outerWidth - x - size) : x;
PainterHighQualityEnabler hq(p);
p.setBrush(bg);
p.setPen(Qt::NoPen);
p.drawEllipse(x, y, size, size);
PaintMyNotesInner(p, x, y, size, fg);
}
QImage EmptyUserpic::GenerateMyNotes(int size) {
return Generate(size, [&](QPainter &p) {
PaintMyNotes(p, 0, 0, size, size);
});
}
std::pair<uint64, uint64> EmptyUserpic::uniqueKey() const {
const auto first = (uint64(0xFFFFFFFFU) << 32)
| anim::getPremultiplied(_colors.color1->c);