From 3f56d76a2b0d528c05ab8d0a38059ca82ba90952 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 26 Jul 2025 00:39:23 +0530 Subject: Add set_html for views + example use with decorations --- src/widgets/BrowserWindow.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/widgets/BrowserWindow.hpp') diff --git a/src/widgets/BrowserWindow.hpp b/src/widgets/BrowserWindow.hpp index 207524a..92eafa7 100644 --- a/src/widgets/BrowserWindow.hpp +++ b/src/widgets/BrowserWindow.hpp @@ -46,6 +46,13 @@ public: webview_stack->open_url(url, open_type, webview_id); } + void set_html(const QString &html, WebViewId webview_id) { + if (decorations->has_webview(webview_id)) + decorations->set_html(html, webview_id); + else + webview_stack->set_html(html, webview_id); + } + bool on_window_key_event(QKeyEvent *event); void closeEvent(QCloseEvent * /*event*/) override { emit closed(); }; -- cgit v1.3.1