diff --git a/src/plugins/MouseGestures/mousegestures.cpp b/src/plugins/MouseGestures/mousegestures.cpp
index c39b5b92c..2579e8934 100644
--- a/src/plugins/MouseGestures/mousegestures.cpp
+++ b/src/plugins/MouseGestures/mousegestures.cpp
@@ -16,8 +16,9 @@
* along with this program. If not, see .
* ============================================================ */
#include "mousegestures.h"
-#include "webview.h"
#include "webpage.h"
+#include "tabbedwebview.h"
+#include "tabwidget.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "mousegesturessettingsdialog.h"
@@ -54,6 +55,12 @@ MouseGestures::MouseGestures(QObject* parent) :
QjtMouseGesture* upDownGesture = new QjtMouseGesture(DirectionList() << Up << Down, m_filter);
connect(upDownGesture, SIGNAL(gestured()), this, SLOT(upDownGestured()));
+ QjtMouseGesture* upLeftGesture = new QjtMouseGesture(DirectionList() << Up << Left, m_filter);
+ connect(upLeftGesture, SIGNAL(gestured()), this, SLOT(upLeftGestured()));
+
+ QjtMouseGesture* upRightGesture = new QjtMouseGesture(DirectionList() << Up << Right, m_filter);
+ connect(upRightGesture, SIGNAL(gestured()), this, SLOT(upRightGestured()));
+
m_filter->addGesture(upGesture);
m_filter->addGesture(downGesture);
m_filter->addGesture(leftGesture);
@@ -62,6 +69,8 @@ MouseGestures::MouseGestures(QObject* parent) :
m_filter->addGesture(downRightGesture);
m_filter->addGesture(downLeftGesture);
m_filter->addGesture(upDownGesture);
+ m_filter->addGesture(upLeftGesture);
+ m_filter->addGesture(upRightGesture);
}
bool MouseGestures::mousePress(QObject* obj, QMouseEvent* event)
@@ -165,6 +174,26 @@ void MouseGestures::upDownGestured()
m_view.data()->reload();
}
+void MouseGestures::upLeftGestured()
+{
+ TabbedWebView* view = qobject_cast(m_view.data());
+ if (!view) {
+ return;
+ }
+
+ view->tabWidget()->previousTab();
+}
+
+void MouseGestures::upRightGestured()
+{
+ TabbedWebView* view = qobject_cast(m_view.data());
+ if (!view) {
+ return;
+ }
+
+ view->tabWidget()->nextTab();
+}
+
MouseGestures::~MouseGestures()
{
m_filter->clearGestures(true);
diff --git a/src/plugins/MouseGestures/mousegestures.h b/src/plugins/MouseGestures/mousegestures.h
index da53170a8..5bb236c1b 100644
--- a/src/plugins/MouseGestures/mousegestures.h
+++ b/src/plugins/MouseGestures/mousegestures.h
@@ -49,8 +49,8 @@ private slots:
void downLeftGestured();
void upDownGestured();
-// void upLeftGestured();
-// void upRightGestured();
+ void upLeftGestured();
+ void upRightGestured();
private:
QjtMouseGestureFilter* m_filter;
diff --git a/src/plugins/MouseGestures/mousegesturessettingsdialog.ui b/src/plugins/MouseGestures/mousegesturessettingsdialog.ui
index 9d5250721..c9a46d24b 100644
--- a/src/plugins/MouseGestures/mousegesturessettingsdialog.ui
+++ b/src/plugins/MouseGestures/mousegesturessettingsdialog.ui
@@ -7,7 +7,7 @@
0
0
502
- 355
+ 420
@@ -140,20 +140,6 @@
- -
-
-
- :/mousegestures/data/right.gif
-
-
-
- -
-
-
- <b>Forward</b><br/>Go forward in history
-
-
-
-
@@ -189,19 +175,61 @@
-
+
+
+ :/mousegestures/data/right.gif
+
+
+
+ -
+
+
+ <b>Forward</b><br/>Go forward in history
+
+
+
+ -
+
+
+ <b>Previous tab</b><br/>Switch to previous tab
+
+
+
+ -
:/mousegestures/data/down-left.gif
- -
+
-
<b>Home</b><br/>Go to homepage
+ -
+
+
+ :/mousegestures/data/up-right.gif
+
+
+
+ -
+
+
+ <b>Next tab</b><br/>Switch to next tab
+
+
+
+ -
+
+
+ :/mousegestures/data/up-left.gif
+
+
+
-