mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
Initial external webview webapps on Linux.
This commit is contained in:
@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/vertical_list.h"
|
||||
#include "ui/gl/gl_detection.h"
|
||||
#include "ui/chat/attach/attach_bot_webview.h"
|
||||
#include "ui/chat/chat_style_radius.h"
|
||||
#include "ui/controls/compose_ai_button_factory.h"
|
||||
#include "base/options.h"
|
||||
@@ -251,6 +252,7 @@ void SetupExperimental(
|
||||
addToggle(Info::Profile::kOptionShowPeerIdBelowAbout);
|
||||
addToggle(Info::Profile::kOptionShowChannelJoinedBelowAbout);
|
||||
addToggle(Ui::kOptionUseSmallMsgBubbleRadius);
|
||||
addToggle(Ui::BotWebView::kOptionLinuxExternalBotWebApps);
|
||||
addToggle(Media::Player::kOptionDisableAutoplayNext);
|
||||
addToggle(Webview::kOptionWebviewDebugEnabled);
|
||||
addToggle(Webview::kOptionWebviewLegacyEdge);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,8 @@ using LayerOptions = base::flags<LayerOption>;
|
||||
|
||||
namespace Webview {
|
||||
struct Available;
|
||||
struct PopupArgs;
|
||||
struct PopupResult;
|
||||
} // namespace Webview
|
||||
|
||||
namespace Ui::Text {
|
||||
@@ -39,6 +41,8 @@ struct MarkedContext;
|
||||
|
||||
namespace Ui::BotWebView {
|
||||
|
||||
extern const char kOptionLinuxExternalBotWebApps[];
|
||||
|
||||
struct DownloadsProgress;
|
||||
struct DownloadsEntry;
|
||||
enum class DownloadsAction;
|
||||
@@ -171,6 +175,20 @@ private:
|
||||
bool showWebview(Args &&args, const Webview::ThemeParams ¶ms);
|
||||
|
||||
bool createWebview(const Webview::ThemeParams ¶ms);
|
||||
void installExternalShellDocument();
|
||||
void sendExternalShellBootstrap();
|
||||
void sendExternalShellMethod(
|
||||
const QByteArray &method,
|
||||
const QJsonObject &data);
|
||||
void sendExternalShellEvent(
|
||||
const QString &event,
|
||||
const QByteArray &data);
|
||||
void sendExternalShellButton(
|
||||
const char *name,
|
||||
const QJsonObject &args);
|
||||
void sendExternalShellChrome();
|
||||
void setExternalShellBlocked(bool blocked);
|
||||
Webview::PopupResult showBlockingPopup(Webview::PopupArgs &&args);
|
||||
void createWebviewBottom();
|
||||
void showWebviewProgress();
|
||||
void hideWebviewProgress();
|
||||
@@ -238,14 +256,24 @@ private:
|
||||
[[nodiscard]] QRect progressRect() const;
|
||||
void setupProgressGeometry();
|
||||
void layoutButtons();
|
||||
void finishExternalBox(not_null<SeparatePanel*> panel);
|
||||
|
||||
Webview::StorageId _storageId;
|
||||
const not_null<Delegate*> _delegate;
|
||||
QString _externalUrl;
|
||||
QString _externalTitle;
|
||||
int _externalBlockCount = 0;
|
||||
bool _closeNeedConfirmation = false;
|
||||
bool _hasSettingsButton = false;
|
||||
bool _externalShell = false;
|
||||
bool _externalShellBootstrapped = false;
|
||||
bool _externalBackVisible = false;
|
||||
MenuButtons _menuButtons = {};
|
||||
std::unique_ptr<RpWidget> _externalPanelParent;
|
||||
std::unique_ptr<SeparatePanel> _widget;
|
||||
std::unique_ptr<WebviewWithLifetime> _webview;
|
||||
std::vector<std::unique_ptr<SeparatePanel>> _externalBoxes;
|
||||
std::unique_ptr<RpWidget> _externalWebviewParent;
|
||||
std::unique_ptr<RpWidget> _webviewBottom;
|
||||
QPointer<FlatLabel> _webviewBottomLabel;
|
||||
rpl::variable<QString> _bottomText;
|
||||
|
||||
Reference in New Issue
Block a user