From 4f945367ebc8e34263acbfca0416e3f75653924e Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 30 Mar 2025 19:16:07 +0530 Subject: Update window title on tab change + refactoring --- src/WindowActionRouter.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/WindowActionRouter.hpp') diff --git a/src/WindowActionRouter.hpp b/src/WindowActionRouter.hpp index 9a5059b..384c76c 100644 --- a/src/WindowActionRouter.hpp +++ b/src/WindowActionRouter.hpp @@ -3,15 +3,25 @@ #include #include #include +#include #include "widgets/BrowserWindow.hpp" +#include "widgets/WebViewStack.hpp" + +#define WITH_WEBVIEW_WINDOW(WEBVIEW_ID, IDENT, BLOCK) \ + for (auto &win_match : window_map) { \ + auto *IDENT = win_match.second; \ + if (IDENT->mediator()->has_webview(WEBVIEW_ID)) { \ + BLOCK; \ + } \ + } class WindowActionRouter : public QWidget { Q_OBJECT public: - static WindowActionRouter *instance() { - static auto *router = new WindowActionRouter; + static WindowActionRouter &instance() { + static WindowActionRouter router; return router; } -- cgit v1.3.1