mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-11 22:23:49 +00:00
Added chat theme bubble gradient to all chats.
This commit is contained in:
@@ -247,8 +247,9 @@ constexpr auto kMinAcceptableContrast = 1.14;// 4.5;
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] QImage PrepareBubblesBackground(
|
||||
const ChatThemeBubblesData &data) {
|
||||
} // namespace
|
||||
|
||||
QImage PrepareBubblesBackground(const ChatThemeBubblesData &data) {
|
||||
if (data.colors.size() < 2) {
|
||||
return QImage();
|
||||
}
|
||||
@@ -256,8 +257,6 @@ constexpr auto kMinAcceptableContrast = 1.14;// 4.5;
|
||||
return Images::GenerateLinearGradient(QSize(kSize, kSize), data.colors);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool operator==(const ChatThemeBackground &a, const ChatThemeBackground &b) {
|
||||
return (a.key == b.key)
|
||||
&& (a.prepared.cacheKey() == b.prepared.cacheKey())
|
||||
@@ -551,7 +550,10 @@ void ChatTheme::setBubblesBackground(QImage image) {
|
||||
: _bubblesBackground.area),
|
||||
});
|
||||
if (!_bubblesBackgroundPattern) {
|
||||
_bubblesBackgroundPattern = PrepareBubblePattern(palette());
|
||||
const auto use = _palette
|
||||
? _palette.get()
|
||||
: style::main_palette::get().get();
|
||||
_bubblesBackgroundPattern = PrepareBubblePattern(use);
|
||||
}
|
||||
_bubblesBackgroundPattern->pixmap = _bubblesBackground.pixmap;
|
||||
// setBubblesBackground called only from background thread.
|
||||
|
||||
Reference in New Issue
Block a user