diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-07-02 14:36:54 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-07-02 14:36:54 +0200 |
commit | f47e32c5d0451308d5f0ff99e31397bd8ce53f73 (patch) | |
tree | 33c5ee229529878fc399c159993e2a8538f9d06c /src/widgets | |
parent | Configuration defaults file (diff) | |
download | smolbote-f47e32c5d0451308d5f0ff99e31397bd8ce53f73.tar.xz |
Added homepage button
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/webviewtabbar.cpp | 15 | ||||
-rw-r--r-- | src/widgets/webviewtabbar.h | 7 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/widgets/webviewtabbar.cpp b/src/widgets/webviewtabbar.cpp index 4d3a859..bd24304 100644 --- a/src/widgets/webviewtabbar.cpp +++ b/src/widgets/webviewtabbar.cpp @@ -172,5 +172,18 @@ void WebViewTabBar::updateVectorArrangement(int from, int to) void WebViewTabBar::webAction(int action) { - currentView()->pageAction(static_cast<QWebEnginePage::WebAction>(action))->trigger(); + switch (action) { + case WebActions::Back: + currentView()->pageAction(QWebEnginePage::Back)->trigger(); + break; + case WebActions::Forward: + currentView()->pageAction(QWebEnginePage::Forward)->trigger(); + break; + case WebActions::Reload: + currentView()->pageAction(QWebEnginePage::Reload)->trigger(); + break; + case WebActions::Homepage: + currentView()->load(m_profile->homepage()); + break; + } } diff --git a/src/widgets/webviewtabbar.h b/src/widgets/webviewtabbar.h index 31a3ab2..4682a94 100644 --- a/src/widgets/webviewtabbar.h +++ b/src/widgets/webviewtabbar.h @@ -31,6 +31,13 @@ class WebViewTabBar : public QTabBar Q_OBJECT public: + enum WebActions { + Back = QWebEnginePage::Back, + Forward = QWebEnginePage::Forward, + Reload = QWebEnginePage::Reload, + Homepage + }; + explicit WebViewTabBar(WebEngineProfile *profile = nullptr, QWidget *parent = 0); ~WebViewTabBar(); |