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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user