2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 23:25:15 +00:00

Use rpl for Window::Theme::Background updates.

This commit is contained in:
John Preston
2021-07-15 14:12:38 +03:00
parent 7e83088a84
commit 4276b6cce0
66 changed files with 203 additions and 262 deletions

View File

@@ -98,9 +98,12 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) {
using Window::Theme::BackgroundUpdate;
Window::Theme::Background()->updates(
) | rpl::start_with_next([=](const BackgroundUpdate &data) {
themeUpdated(data);
});
}, lifetime());
Core::App().passcodeLockChanges(
) | rpl::start_with_next([=] {
updateGlobalMenu();
@@ -571,7 +574,7 @@ void MainWindow::themeUpdated(const Window::Theme::BackgroundUpdate &data) {
using Type = Window::Theme::BackgroundUpdate::Type;
// We delay animating theme warning because we want all other
// subscribers to receive paltte changed notification before any
// subscribers to receive palette changed notification before any
// animations (that include pixmap caches with old palette values).
if (data.type == Type::TestingTheme) {
if (!_testingThemeWarning) {