diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-26 11:59:38 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-26 11:59:38 +0530 |
| commit | 2078c60477842d7cf6991148e23979565737a8b5 (patch) | |
| tree | 980e2aea150e85c6b87f2b521fce1006486244d8 /src/widgets/BrowserWindow.hpp | |
| parent | 68448538172663279919b29dd09b5faa51e0628a (diff) | |
| download | null-browser-2078c60477842d7cf6991148e23979565737a8b5.tar.gz null-browser-2078c60477842d7cf6991148e23979565737a8b5.zip | |
Refactor heavy + extras.tabline module (incomplete)
Diffstat (limited to 'src/widgets/BrowserWindow.hpp')
| -rw-r--r-- | src/widgets/BrowserWindow.hpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/widgets/BrowserWindow.hpp b/src/widgets/BrowserWindow.hpp index 92eafa7..e434521 100644 --- a/src/widgets/BrowserWindow.hpp +++ b/src/widgets/BrowserWindow.hpp @@ -5,6 +5,7 @@ #include "Configuration.hpp" #include "utils.hpp" #include "widgets/Decorations.hpp" +#include "widgets/IWebViewMediator.hpp" #include "widgets/WebViewStack.hpp" using WindowId = qsizetype; @@ -18,12 +19,10 @@ public: DEFINE_GETTER(get_id, win_id) DEFINE_SETTER(set_id, win_id) - // DELEGATE(webview_stack, has_webview, has_webview) DELEGATE(webview_stack, current_webview_id, current_webview_id) DELEGATE(webview_stack, get_webview_list, get_webview_list) DELEGATE(webview_stack, set_search_text, set_search_text) DELEGATE(webview_stack, open_devtools, open_devtools) - // DELEGATE(webview_stack, open_url, open_url) DELEGATE(webview_stack, webview_history_back, history_back) DELEGATE(webview_stack, webview_history_forward, history_forward) DELEGATE(webview_stack, close, close_webview) @@ -35,23 +34,10 @@ public: DELEGATE(decorations, get_enabled, get_decoration_enabled) DELEGATE(decorations, get_view_id, get_decoration_view_id) - bool has_webview(WebViewId webview_id) { - return webview_stack->has_webview(webview_id) || decorations->has_webview(webview_id); - } - - void open_url(const QUrl &url, OpenType open_type, WebViewId webview_id) { - if (decorations->has_webview(webview_id)) - decorations->open_url(url, webview_id); - else - 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); - } + IWebViewMediator *get_webview_mediator(WebViewId webview_id); + bool has_webview(WebViewId webview_id); + void open_url(const QUrl &url, OpenType open_type, WebViewId webview_id); + void set_html(const QString &html, WebViewId webview_id); bool on_window_key_event(QKeyEvent *event); |
