Skip to content

Commit 85b39f3

Browse files
committed
Pass initial size from the main app.
1 parent 8e4cb7c commit 85b39f3

3 files changed

Lines changed: 4 additions & 16 deletions

File tree

Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,19 +1725,6 @@ void Panel::sendExternalShellButton(
17251725
});
17261726
}
17271727

1728-
void Panel::setInitialExternalShellWindowSize() {
1729-
if (!_externalShell || !_webview) {
1730-
return;
1731-
}
1732-
const auto view = _webview->window.widget();
1733-
if (!view) {
1734-
return;
1735-
}
1736-
const auto size = LinuxShell::WindowSize(st::botWebViewPanelSize);
1737-
_webview->window.resize(size);
1738-
view->resize(size);
1739-
}
1740-
17411728
void Panel::applyExternalShellFullscreen(bool fullscreen) {
17421729
if (!_externalShell || !_webview) {
17431730
return;
@@ -2029,6 +2016,9 @@ bool Panel::createWebview(const Webview::ThemeParams &params) {
20292016
.windowMargins = _externalShell
20302017
? st::botWebViewShellShadowPadding
20312018
: QMargins(),
2019+
.initialSize = _externalShell
2020+
? LinuxShell::WindowSize(st::botWebViewPanelSize)
2021+
: QSize(),
20322022
.shellMessageToken = _externalShell
20332023
? _externalShellToken
20342024
: QString(),
@@ -2098,7 +2088,6 @@ bool Panel::createWebview(const Webview::ThemeParams &params) {
20982088
});
20992089

21002090
if (_externalShell) {
2101-
setInitialExternalShellWindowSize();
21022091
applyExternalShellFullscreen(_fullscreen.current());
21032092
} else {
21042093
rpl::combine(

Telegram/SourceFiles/ui/chat/attach/attach_bot_webview.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ class Panel final : public base::has_weak_ptr {
235235
void sendExternalShellAssets();
236236
void handleExternalShellMenuAction(const QString &id);
237237
void requestExternalShellButtonEmoji(const QString &name);
238-
void setInitialExternalShellWindowSize();
239238
void applyExternalShellFullscreen(bool fullscreen);
240239
void sendExternalShellChrome();
241240
void setExternalShellBlocked(bool blocked);

0 commit comments

Comments
 (0)