diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-16 15:28:00 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-16 15:29:59 +0530 |
| commit | 041f8933be28d0fcff1196792f30c5ca3176c155 (patch) | |
| tree | 5fceaf5844f3312e8db63425c5c25825df594861 /include/widgets/WebViewStack.hpp | |
| parent | 350d2bd7ccf80b91abdff154344f0ce88080a195 (diff) | |
| download | null-browser-041f8933be28d0fcff1196792f30c5ca3176c155.tar.gz null-browser-041f8933be28d0fcff1196792f30c5ca3176c155.zip | |
Add configuration class
Diffstat (limited to '')
| -rw-r--r-- | include/widgets/WebViewStack.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/widgets/WebViewStack.hpp b/include/widgets/WebViewStack.hpp index faf4562..34b1658 100644 --- a/include/widgets/WebViewStack.hpp +++ b/include/widgets/WebViewStack.hpp @@ -5,6 +5,7 @@ #include <QWebEngineView> #include <sys/types.h> +#include "Configuration.hpp" #include "completion/TabsModel.hpp" enum OpenType { OpenUrl, OpenUrlInTab, OpenUrlInBgTab, OpenUrlInWindow }; @@ -16,11 +17,11 @@ public: inline static const QUrl NewtabURL = QUrl("about:blank"); public: - WebViewStack(QWebEngineProfile *profile = new QWebEngineProfile, + WebViewStack(const Configuration *configuration, + QWebEngineProfile *profile = new QWebEngineProfile, QWidget *parent = nullptr); - void openUrl(QUrl url = WebViewStack::NewtabURL, - OpenType openType = OpenType::OpenUrl); + void openUrl(QUrl url, OpenType openType = OpenType::OpenUrl); std::vector<QUrl> urls(); u_int32_t currentWebViewIndex(); @@ -38,13 +39,13 @@ public: private: void setCurrentUrl(QUrl url); - QWebEngineView *createNewWebView(QUrl url = WebViewStack::NewtabURL, - bool focus = false); + QWebEngineView *createNewWebView(QUrl url, bool focus = false); private slots: void onNewWebViewRequest(QWebEngineNewWindowRequest &request); private: + const Configuration *configuration; QWebEngineProfile *profile; QStackedLayout *layout; QList<QWebEngineView *> webViewList; |
