2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35: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

@@ -27,7 +27,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h"
#include "history/history_message.h"
#include "history/view/history_view_schedule_box.h"
#include "window/themes/window_theme.h"
#include "window/window_session_controller.h"
#include "boxes/peer_list_box.h"
#include "chat_helpers/emoji_suggestions_widget.h"
@@ -42,7 +41,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_boxes.h"
#include "styles/style_chat.h"
class ShareBox::Inner final : public Ui::RpWidget, private base::Subscriber {
class ShareBox::Inner final : public Ui::RpWidget {
public:
Inner(QWidget *parent, const Descriptor &descriptor);
@@ -598,11 +597,10 @@ ShareBox::Inner::Inner(QWidget *parent, const Descriptor &descriptor)
update();
}, lifetime());
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &update) {
if (update.paletteChanged()) {
invalidateCache();
}
});
style::PaletteChanged(
) | rpl::start_with_next([=] {
invalidateCache();
}, lifetime());
}
void ShareBox::Inner::invalidateCache() {