mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-29 13:47:47 +00:00
Fix rounding of Replies userpic
This commit is contained in:
parent
eab12695bb
commit
19c1764bd1
@ -373,10 +373,36 @@ void EmptyUserpic::PaintRepliesMessages(
|
|||||||
int y,
|
int y,
|
||||||
int outerWidth,
|
int outerWidth,
|
||||||
int size) {
|
int size) {
|
||||||
|
switch (cUserpicCornersType()) {
|
||||||
|
case 0:
|
||||||
|
PaintRepliesMessagesSquared(p, x, y, outerWidth, size);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
PaintRepliesMessagesRounded(p, x, y, outerWidth, size);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
PaintRepliesMessagesRoundedLarge(p, x, y, outerWidth, size);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
const auto &bg = st::historyPeerSavedMessagesBg;
|
const auto &bg = st::historyPeerSavedMessagesBg;
|
||||||
const auto &fg = st::historyPeerUserpicFg;
|
const auto &fg = st::historyPeerUserpicFg;
|
||||||
PaintRepliesMessages(p, x, y, outerWidth, size, bg, fg);
|
PaintRepliesMessages(p, x, y, outerWidth, size, bg, fg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EmptyUserpic::PaintRepliesMessagesRoundedLarge(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size) {
|
||||||
|
const auto &bg = st::historyPeerSavedMessagesBg;
|
||||||
|
const auto &fg = st::historyPeerUserpicFg;
|
||||||
|
PaintRepliesMessagesRoundedLarge(p, x, y, outerWidth, size, bg, fg);
|
||||||
|
}
|
||||||
|
|
||||||
void EmptyUserpic::PaintRepliesMessagesRounded(
|
void EmptyUserpic::PaintRepliesMessagesRounded(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
@ -389,6 +415,17 @@ void EmptyUserpic::PaintRepliesMessagesRounded(
|
|||||||
PaintRepliesMessagesRounded(p, x, y, outerWidth, size, bg, fg);
|
PaintRepliesMessagesRounded(p, x, y, outerWidth, size, bg, fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmptyUserpic::PaintRepliesMessagesSquared(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size) {
|
||||||
|
const auto &bg = st::historyPeerSavedMessagesBg;
|
||||||
|
const auto &fg = st::historyPeerUserpicFg;
|
||||||
|
PaintRepliesMessagesSquared(p, x, y, outerWidth, size, bg, fg);
|
||||||
|
}
|
||||||
|
|
||||||
void EmptyUserpic::PaintRepliesMessages(
|
void EmptyUserpic::PaintRepliesMessages(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
int x,
|
int x,
|
||||||
@ -407,6 +444,24 @@ void EmptyUserpic::PaintRepliesMessages(
|
|||||||
PaintRepliesMessagesInner(p, x, y, size, bg, fg);
|
PaintRepliesMessagesInner(p, x, y, size, bg, fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmptyUserpic::PaintRepliesMessagesRoundedLarge(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
const style::color &bg,
|
||||||
|
const style::color &fg) {
|
||||||
|
x = rtl() ? (outerWidth - x - size) : x;
|
||||||
|
|
||||||
|
PainterHighQualityEnabler hq(p);
|
||||||
|
p.setBrush(bg);
|
||||||
|
p.setPen(Qt::NoPen);
|
||||||
|
p.drawRoundedRect(x, y, size, size, st::dateRadius, st::dateRadius);
|
||||||
|
|
||||||
|
PaintRepliesMessagesInner(p, x, y, size, bg, fg);
|
||||||
|
}
|
||||||
|
|
||||||
void EmptyUserpic::PaintRepliesMessagesRounded(
|
void EmptyUserpic::PaintRepliesMessagesRounded(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
int x,
|
int x,
|
||||||
@ -425,6 +480,24 @@ void EmptyUserpic::PaintRepliesMessagesRounded(
|
|||||||
PaintRepliesMessagesInner(p, x, y, size, bg, fg);
|
PaintRepliesMessagesInner(p, x, y, size, bg, fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmptyUserpic::PaintRepliesMessagesSquared(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
const style::color &bg,
|
||||||
|
const style::color &fg) {
|
||||||
|
x = rtl() ? (outerWidth - x - size) : x;
|
||||||
|
|
||||||
|
PainterHighQualityEnabler hq(p);
|
||||||
|
p.setBrush(bg);
|
||||||
|
p.setPen(Qt::NoPen);
|
||||||
|
p.drawRoundedRect(x, y, size, size, 0, 0);
|
||||||
|
|
||||||
|
PaintRepliesMessagesInner(p, x, y, size, bg, fg);
|
||||||
|
}
|
||||||
|
|
||||||
QPixmap EmptyUserpic::GenerateRepliesMessages(int size) {
|
QPixmap EmptyUserpic::GenerateRepliesMessages(int size) {
|
||||||
return Generate(size, [&](Painter &p) {
|
return Generate(size, [&](Painter &p) {
|
||||||
PaintRepliesMessages(p, 0, 0, size, size);
|
PaintRepliesMessages(p, 0, 0, size, size);
|
||||||
|
@ -105,12 +105,24 @@ public:
|
|||||||
int y,
|
int y,
|
||||||
int outerWidth,
|
int outerWidth,
|
||||||
int size);
|
int size);
|
||||||
|
static void PaintRepliesMessagesRoundedLarge(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size);
|
||||||
static void PaintRepliesMessagesRounded(
|
static void PaintRepliesMessagesRounded(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int outerWidth,
|
int outerWidth,
|
||||||
int size);
|
int size);
|
||||||
|
static void PaintRepliesMessagesSquared(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size);
|
||||||
static void PaintRepliesMessages(
|
static void PaintRepliesMessages(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
int x,
|
int x,
|
||||||
@ -119,6 +131,14 @@ public:
|
|||||||
int size,
|
int size,
|
||||||
const style::color &bg,
|
const style::color &bg,
|
||||||
const style::color &fg);
|
const style::color &fg);
|
||||||
|
static void PaintRepliesMessagesRoundedLarge(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
const style::color &bg,
|
||||||
|
const style::color &fg);
|
||||||
static void PaintRepliesMessagesRounded(
|
static void PaintRepliesMessagesRounded(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
int x,
|
int x,
|
||||||
@ -127,6 +147,14 @@ public:
|
|||||||
int size,
|
int size,
|
||||||
const style::color &bg,
|
const style::color &bg,
|
||||||
const style::color &fg);
|
const style::color &fg);
|
||||||
|
static void PaintRepliesMessagesSquared(
|
||||||
|
Painter &p,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
int outerWidth,
|
||||||
|
int size,
|
||||||
|
const style::color &bg,
|
||||||
|
const style::color &fg);
|
||||||
static QPixmap GenerateRepliesMessages(int size);
|
static QPixmap GenerateRepliesMessages(int size);
|
||||||
static QPixmap GenerateRepliesMessagesRounded(int size);
|
static QPixmap GenerateRepliesMessagesRounded(int size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user