parent
7d1cc67019
commit
5e12cd27df
|
@ -356,7 +356,7 @@ Panel::Panel(
|
|||
postEvent("back_button_pressed");
|
||||
}, _widget->lifetime());
|
||||
|
||||
rpl::combine(
|
||||
rpl::merge(
|
||||
style::PaletteChanged(),
|
||||
_themeUpdateForced.events()
|
||||
) | rpl::filter([=] {
|
||||
|
@ -631,6 +631,8 @@ bool Panel::createWebview() {
|
|||
processBackButtonMessage(arguments);
|
||||
} else if (command == "web_app_request_theme") {
|
||||
_themeUpdateForced.fire({});
|
||||
} else if (command == "web_app_request_viewport") {
|
||||
sendViewport();
|
||||
} else if (command == "web_app_open_tg_link") {
|
||||
openTgLink(arguments);
|
||||
} else if (command == "web_app_open_link") {
|
||||
|
@ -675,6 +677,13 @@ postEvent: function(eventType, eventData) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void Panel::sendViewport() {
|
||||
postEvent("viewport_changed", "{ "
|
||||
"height: window.innerHeight, "
|
||||
"is_state_stable: true, "
|
||||
"is_expanded: true }");
|
||||
}
|
||||
|
||||
void Panel::setTitle(rpl::producer<QString> title) {
|
||||
_widget->setTitle(std::move(title));
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ private:
|
|||
void createMainButton();
|
||||
void scheduleCloseWithConfirmation();
|
||||
void closeWithConfirmation();
|
||||
void sendViewport();
|
||||
|
||||
using EventData = std::variant<QString, QJsonObject>;
|
||||
void postEvent(const QString &event);
|
||||
|
|
Loading…
Reference in New Issue