mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Apply initial bubble opacity in QImage bubble backgrounds.
This commit is contained in:
parent
784d57a2bc
commit
2b6e04bca3
1 changed files with 6 additions and 2 deletions
|
@ -79,6 +79,8 @@ void PaintBubbleGeneric(
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintPatternBubble(Painter &p, const SimpleBubble &args) {
|
void PaintPatternBubble(Painter &p, const SimpleBubble &args) {
|
||||||
|
const auto opacity = st::msgOutBg->c.alphaF();
|
||||||
|
const auto shadowOpacity = opacity * st::msgOutShadow->c.alphaF();
|
||||||
const auto pattern = args.pattern;
|
const auto pattern = args.pattern;
|
||||||
const auto sh = (args.skip & RectPart::Bottom)
|
const auto sh = (args.skip & RectPart::Bottom)
|
||||||
? nullptr
|
? nullptr
|
||||||
|
@ -103,9 +105,9 @@ void PaintPatternBubble(Painter &p, const SimpleBubble &args) {
|
||||||
};
|
};
|
||||||
const auto fillSh = [&](const QRect &rect) {
|
const auto fillSh = [&](const QRect &rect) {
|
||||||
if (!(args.skip & RectPart::Bottom)) {
|
if (!(args.skip & RectPart::Bottom)) {
|
||||||
p.setOpacity(st::msgOutShadow->c.alphaF());
|
p.setOpacity(shadowOpacity);
|
||||||
fillBg(rect);
|
fillBg(rect);
|
||||||
p.setOpacity(1.);
|
p.setOpacity(opacity);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const auto fillPattern = [&](
|
const auto fillPattern = [&](
|
||||||
|
@ -213,7 +215,9 @@ void PaintPatternBubble(Painter &p, const SimpleBubble &args) {
|
||||||
fillPattern(position.x(), position.y(), tail, pattern->tailCache);
|
fillPattern(position.x(), position.y(), tail, pattern->tailCache);
|
||||||
return tail.width() / int(tail.devicePixelRatio());
|
return tail.width() / int(tail.devicePixelRatio());
|
||||||
};
|
};
|
||||||
|
p.setOpacity(opacity);
|
||||||
PaintBubbleGeneric(args, fillBg, fillSh, fillRounded, paintTail);
|
PaintBubbleGeneric(args, fillBg, fillSh, fillRounded, paintTail);
|
||||||
|
p.setOpacity(1.);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintSolidBubble(Painter &p, const SimpleBubble &args) {
|
void PaintSolidBubble(Painter &p, const SimpleBubble &args) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue