mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Add a simple way of testing color themes.
This commit is contained in:
@@ -1399,13 +1399,14 @@ auto SessionController::cachedChatThemeValue(
|
||||
if (i == end(_customChatThemes)) {
|
||||
cacheChatTheme(data);
|
||||
}
|
||||
const auto limit = Data::CloudThemes::TestingColors() ? (1 << 20) : 1;
|
||||
using namespace rpl::mappers;
|
||||
return rpl::single(
|
||||
_defaultChatTheme
|
||||
) | rpl::then(_cachedThemesStream.events(
|
||||
) | rpl::filter([=](const std::shared_ptr<Ui::ChatTheme> &theme) {
|
||||
return (theme->key() == key);
|
||||
}) | rpl::take(1));
|
||||
}) | rpl::take(limit));
|
||||
}
|
||||
|
||||
void SessionController::setChatStyleTheme(
|
||||
@@ -1417,6 +1418,10 @@ void SessionController::setChatStyleTheme(
|
||||
_chatStyle->apply(theme.get());
|
||||
}
|
||||
|
||||
void SessionController::clearCachedChatThemes() {
|
||||
_customChatThemes.clear();
|
||||
}
|
||||
|
||||
void SessionController::pushDefaultChatBackground() {
|
||||
const auto background = Theme::Background();
|
||||
const auto &paper = background->paper();
|
||||
|
Reference in New Issue
Block a user