mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
parent
7d1cc67019
commit
5e12cd27df
2 changed files with 11 additions and 1 deletions
|
@ -356,7 +356,7 @@ Panel::Panel(
|
||||||
postEvent("back_button_pressed");
|
postEvent("back_button_pressed");
|
||||||
}, _widget->lifetime());
|
}, _widget->lifetime());
|
||||||
|
|
||||||
rpl::combine(
|
rpl::merge(
|
||||||
style::PaletteChanged(),
|
style::PaletteChanged(),
|
||||||
_themeUpdateForced.events()
|
_themeUpdateForced.events()
|
||||||
) | rpl::filter([=] {
|
) | rpl::filter([=] {
|
||||||
|
@ -631,6 +631,8 @@ bool Panel::createWebview() {
|
||||||
processBackButtonMessage(arguments);
|
processBackButtonMessage(arguments);
|
||||||
} else if (command == "web_app_request_theme") {
|
} else if (command == "web_app_request_theme") {
|
||||||
_themeUpdateForced.fire({});
|
_themeUpdateForced.fire({});
|
||||||
|
} else if (command == "web_app_request_viewport") {
|
||||||
|
sendViewport();
|
||||||
} else if (command == "web_app_open_tg_link") {
|
} else if (command == "web_app_open_tg_link") {
|
||||||
openTgLink(arguments);
|
openTgLink(arguments);
|
||||||
} else if (command == "web_app_open_link") {
|
} else if (command == "web_app_open_link") {
|
||||||
|
@ -675,6 +677,13 @@ postEvent: function(eventType, eventData) {
|
||||||
return true;
|
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) {
|
void Panel::setTitle(rpl::producer<QString> title) {
|
||||||
_widget->setTitle(std::move(title));
|
_widget->setTitle(std::move(title));
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,7 @@ private:
|
||||||
void createMainButton();
|
void createMainButton();
|
||||||
void scheduleCloseWithConfirmation();
|
void scheduleCloseWithConfirmation();
|
||||||
void closeWithConfirmation();
|
void closeWithConfirmation();
|
||||||
|
void sendViewport();
|
||||||
|
|
||||||
using EventData = std::variant<QString, QJsonObject>;
|
using EventData = std::variant<QString, QJsonObject>;
|
||||||
void postEvent(const QString &event);
|
void postEvent(const QString &event);
|
||||||
|
|
Loading…
Add table
Reference in a new issue