2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +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

@@ -19,7 +19,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/empty_userpic.h"
#include "ui/ui_utility.h"
#include "dialogs/dialogs_layout.h"
#include "window/themes/window_theme.h"
#include "window/window_controller.h"
#include "storage/file_download.h"
#include "main/main_session.h"
@@ -641,18 +640,17 @@ Notification::Notification(
prepareActionsCache();
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) {
if (data.paletteChanged()) {
updateNotifyDisplay();
if (!_buttonsCache.isNull()) {
prepareActionsCache();
}
update();
if (_background) {
_background->update();
}
style::PaletteChanged(
) | rpl::start_with_next([=] {
updateNotifyDisplay();
if (!_buttonsCache.isNull()) {
prepareActionsCache();
}
});
update();
if (_background) {
_background->update();
}
}, lifetime());
show();
}
@@ -1077,11 +1075,10 @@ HideAllButton::HideAllButton(
hide();
createWinId();
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &data) {
if (data.paletteChanged()) {
update();
}
});
style::PaletteChanged(
) | rpl::start_with_next([=] {
update();
}, lifetime());
show();
}