mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Handle "web_app_request_theme" event in WebView.
This commit is contained in:
parent
3cdb82a0bf
commit
ce79c1f0c4
2 changed files with 6 additions and 1 deletions
|
@ -322,7 +322,9 @@ Panel::Panel(
|
|||
_widget->closeEvents(
|
||||
) | rpl::start_with_next(_close, _widget->lifetime());
|
||||
|
||||
style::PaletteChanged(
|
||||
rpl::combine(
|
||||
style::PaletteChanged(),
|
||||
_themeUpdateForced.events()
|
||||
) | rpl::filter([=] {
|
||||
return !_themeUpdateScheduled;
|
||||
}) | rpl::start_with_next([=] {
|
||||
|
@ -564,6 +566,8 @@ bool Panel::createWebview() {
|
|||
sendDataMessage(list.at(1));
|
||||
} else if (command == "web_app_setup_main_button") {
|
||||
processMainButtonMessage(list.at(1));
|
||||
} else if (command == "web_app_request_theme") {
|
||||
_themeUpdateForced.fire({});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ private:
|
|||
QPointer<QWidget> _webviewParent;
|
||||
std::unique_ptr<Button> _mainButton;
|
||||
std::unique_ptr<Progress> _progress;
|
||||
rpl::event_stream<> _themeUpdateForced;
|
||||
rpl::lifetime _fgLifetime;
|
||||
rpl::lifetime _bgLifetime;
|
||||
bool _webviewProgress = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue