mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
parent
8fee156d21
commit
2509f05e28
1 changed files with 14 additions and 1 deletions
|
@ -285,6 +285,8 @@ void GroupedMedia::draw(
|
||||||
const QRect &clip,
|
const QRect &clip,
|
||||||
TextSelection selection,
|
TextSelection selection,
|
||||||
crl::time ms) const {
|
crl::time ms) const {
|
||||||
|
auto wasCache = false;
|
||||||
|
auto nowCache = false;
|
||||||
const auto groupPadding = groupedPadding();
|
const auto groupPadding = groupedPadding();
|
||||||
const auto fullSelection = (selection == FullSelection);
|
const auto fullSelection = (selection == FullSelection);
|
||||||
const auto textSelection = (_mode == Mode::Column)
|
const auto textSelection = (_mode == Mode::Column)
|
||||||
|
@ -305,6 +307,9 @@ void GroupedMedia::draw(
|
||||||
const auto highlightOpacity = (_mode == Mode::Grid)
|
const auto highlightOpacity = (_mode == Mode::Grid)
|
||||||
? _parent->highlightOpacity(part.item)
|
? _parent->highlightOpacity(part.item)
|
||||||
: 0.;
|
: 0.;
|
||||||
|
if (!part.cache.isNull()) {
|
||||||
|
wasCache = true;
|
||||||
|
}
|
||||||
part.content->drawGrouped(
|
part.content->drawGrouped(
|
||||||
p,
|
p,
|
||||||
clip,
|
clip,
|
||||||
|
@ -316,6 +321,12 @@ void GroupedMedia::draw(
|
||||||
highlightOpacity,
|
highlightOpacity,
|
||||||
&part.cacheKey,
|
&part.cacheKey,
|
||||||
&part.cache);
|
&part.cache);
|
||||||
|
if (!part.cache.isNull()) {
|
||||||
|
nowCache = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nowCache && !wasCache) {
|
||||||
|
history()->owner().registerHeavyViewPart(_parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// date
|
// date
|
||||||
|
@ -661,7 +672,7 @@ void GroupedMedia::checkAnimation() {
|
||||||
|
|
||||||
bool GroupedMedia::hasHeavyPart() const {
|
bool GroupedMedia::hasHeavyPart() const {
|
||||||
for (const auto &part : _parts) {
|
for (const auto &part : _parts) {
|
||||||
if (part.content->hasHeavyPart()) {
|
if (!part.cache.isNull() || part.content->hasHeavyPart()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -671,6 +682,8 @@ bool GroupedMedia::hasHeavyPart() const {
|
||||||
void GroupedMedia::unloadHeavyPart() {
|
void GroupedMedia::unloadHeavyPart() {
|
||||||
for (const auto &part : _parts) {
|
for (const auto &part : _parts) {
|
||||||
part.content->unloadHeavyPart();
|
part.content->unloadHeavyPart();
|
||||||
|
part.cacheKey = 0;
|
||||||
|
part.cache = QPixmap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue