Improved night mode switching.

This commit is contained in:
John Preston 2018-07-24 22:49:37 +03:00
parent ca6a331a26
commit f852813734
1 changed files with 3 additions and 7 deletions

View File

@ -778,13 +778,9 @@ void ChatBackground::toggleNightMode() {
// Theme editor could have already reverted the testing of this toggle.
if (AreTestingTheme()) {
_nightMode = newNightMode;
if (oldNightMode) {
_tileDayValue = _tileNightValue;
_tileNightValue = oldTileValue;
} else {
_tileNightValue = _tileDayValue;
_tileDayValue = oldTileValue;
}
// Restore the value, it was set inside theme testing.
(oldNightMode ? _tileNightValue : _tileDayValue) = oldTileValue;
// We don't call full KeepApplied() here, because
// we don't need to write theme or overwrite current background.