mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Fix tile background saving after an app update.
Fixes #25666, I hope fixes #16468, I hope fixes #5944.
This commit is contained in:
parent
b962efeca3
commit
aeb71e089a
1 changed files with 14 additions and 2 deletions
|
@ -923,11 +923,21 @@ QImage ChatBackground::createCurrentImage() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatBackground::tile() const {
|
bool ChatBackground::tile() const {
|
||||||
|
if (!started()) {
|
||||||
|
const auto &set = nightMode()
|
||||||
|
? _localStoredTileNightValue
|
||||||
|
: _localStoredTileDayValue;
|
||||||
|
if (set.has_value()) {
|
||||||
|
return *set;
|
||||||
|
}
|
||||||
|
}
|
||||||
return nightMode() ? _tileNightValue : _tileDayValue;
|
return nightMode() ? _tileNightValue : _tileDayValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatBackground::tileDay() const {
|
bool ChatBackground::tileDay() const {
|
||||||
if (Data::details::IsTestingThemeWallPaper(_paper) ||
|
if (!started() && _localStoredTileDayValue.has_value()) {
|
||||||
|
return *_localStoredTileDayValue;
|
||||||
|
} else if (Data::details::IsTestingThemeWallPaper(_paper) ||
|
||||||
Data::details::IsTestingDefaultWallPaper(_paper)) {
|
Data::details::IsTestingDefaultWallPaper(_paper)) {
|
||||||
if (!nightMode()) {
|
if (!nightMode()) {
|
||||||
return _tileForRevert;
|
return _tileForRevert;
|
||||||
|
@ -937,7 +947,9 @@ bool ChatBackground::tileDay() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatBackground::tileNight() const {
|
bool ChatBackground::tileNight() const {
|
||||||
if (Data::details::IsTestingThemeWallPaper(_paper) ||
|
if (!started() && _localStoredTileNightValue.has_value()) {
|
||||||
|
return *_localStoredTileNightValue;
|
||||||
|
} else if (Data::details::IsTestingThemeWallPaper(_paper) ||
|
||||||
Data::details::IsTestingDefaultWallPaper(_paper)) {
|
Data::details::IsTestingDefaultWallPaper(_paper)) {
|
||||||
if (nightMode()) {
|
if (nightMode()) {
|
||||||
return _tileForRevert;
|
return _tileForRevert;
|
||||||
|
|
Loading…
Add table
Reference in a new issue