diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-01 13:19:07 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-01 13:19:07 +0200 |
commit | 74361f5b05dc0a255f489256bd25065ef20f5dee (patch) | |
tree | 279f45e5f2bd093cd6fbf1500fe476f91108bd1f /src/webengine/webview.h | |
parent | Add keyboard shortcuts for address bar menus (diff) | |
download | smolbote-74361f5b05dc0a255f489256bd25065ef20f5dee.tar.xz |
Page menus refactoring
- Split off menus into their own classes
Page tools menu
- Shows injected scripts
- Shows dev tools page in another dialog
Diffstat (limited to 'src/webengine/webview.h')
-rw-r--r-- | src/webengine/webview.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/webengine/webview.h b/src/webengine/webview.h index a274535..1fab1db 100644 --- a/src/webengine/webview.h +++ b/src/webengine/webview.h @@ -6,8 +6,8 @@ * SPDX-License-Identifier: GPL-3.0 */ -#ifndef WEBVIEW_H -#define WEBVIEW_H +#ifndef SMOLBOTE_WEBVIEW_H +#define SMOLBOTE_WEBVIEW_H #include "webpage.h" #include <QWebEngineView> @@ -18,15 +18,26 @@ class WebView : public QWebEngineView { Q_OBJECT public: + enum ViewAction { + BookmarkPage + }; + explicit WebView(MainWindow *parentMainWindow, QWidget *parent = nullptr); ~WebView() override; QMenu *pageMenu(); + QMenu *toolsMenu() { + Q_CHECK_PTR(m_toolsMenu); + return m_toolsMenu; + } - void setPage(WebPage *page); + void setPage(QWebEnginePage *page); + void popupPage(QWebEnginePage *page); bool isLoaded() const; int loadProgress() const; + void triggerViewAction(ViewAction action); + signals: // loadStarted is always emitted, be it page load or in-page request, // but loadFinished is only emitted when it's a page load @@ -43,9 +54,12 @@ private slots: private: MainWindow *m_parent = nullptr; QMenu *m_pageMenu = nullptr; + QMenu *m_toolsMenu = nullptr; bool m_loaded; int m_loadProgress; + + QWebEnginePage *m_devToolsPage; }; -#endif // WEBVIEW_H +#endif // SMOLBOTE_WEBVIEW_H |