From 00812af136452c5879c5827d79a0b2386ac798f3 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Thu, 20 Nov 2014 13:32:31 +1300 Subject: [PATCH 1/4] Add duplicate tab (Down->Up) mouse gesture --- src/plugins/MouseGestures/mousegestures.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/plugins/MouseGestures/mousegestures.cpp b/src/plugins/MouseGestures/mousegestures.cpp index 481776e26..7872ce565 100644 --- a/src/plugins/MouseGestures/mousegestures.cpp +++ b/src/plugins/MouseGestures/mousegestures.cpp @@ -70,6 +70,9 @@ void MouseGestures::initFilter() QjtMouseGesture* downLeftGesture = new QjtMouseGesture(DirectionList() << Down << Left, m_filter); connect(downLeftGesture, SIGNAL(gestured()), this, SLOT(downLeftGestured())); + QjtMouseGesture* downUpGesture = new QjtMouseGesture(DirectionList() << Down << Up, m_filter); + connect(downUpGesture, SIGNAL(gestured()), this, SLOT(downUpGestured())); + QjtMouseGesture* upDownGesture = new QjtMouseGesture(DirectionList() << Up << Down, m_filter); connect(upDownGesture, SIGNAL(gestured()), this, SLOT(upDownGestured())); @@ -86,6 +89,7 @@ void MouseGestures::initFilter() m_filter->addGesture(downRightGesture); m_filter->addGesture(downLeftGesture); + m_filter->addGesture(downUpGesture); m_filter->addGesture(upDownGesture); m_filter->addGesture(upLeftGesture); m_filter->addGesture(upRightGesture); @@ -232,6 +236,19 @@ void MouseGestures::downLeftGestured() m_view.data()->load(mApp->getWindow()->homepageUrl()); } +void MouseGestures::downUpGestured() +{ + TabbedWebView* view = qobject_cast(m_view.data()); + if (!view) + return; + + BrowserWindow* window = view->browserWindow(); + if (!window) + return; + + window->tabWidget()->duplicateTab(); +} + void MouseGestures::upDownGestured() { if (!m_view) { From 3fe5a699ffb79fb2d9048d18348bc073b10276f8 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Thu, 20 Nov 2014 13:34:04 +1300 Subject: [PATCH 2/4] Add down+up gesture to mousegestures header --- src/plugins/MouseGestures/mousegestures.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/MouseGestures/mousegestures.h b/src/plugins/MouseGestures/mousegestures.h index 4f64952fc..e47d6b1f2 100644 --- a/src/plugins/MouseGestures/mousegestures.h +++ b/src/plugins/MouseGestures/mousegestures.h @@ -60,6 +60,7 @@ private slots: void downRightGestured(); void downLeftGestured(); + void downUpGestured(); void upDownGestured(); void upLeftGestured(); From 65a803b9cc2f124e1380d78fe3191c7d1a83ec2f Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Fri, 21 Nov 2014 12:47:40 +1300 Subject: [PATCH 3/4] [MouseGestures] Down+Up tab duplicate gesture needs to know what tab to duplicate --- src/plugins/MouseGestures/mousegestures.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/MouseGestures/mousegestures.cpp b/src/plugins/MouseGestures/mousegestures.cpp index 7872ce565..188bf4601 100644 --- a/src/plugins/MouseGestures/mousegestures.cpp +++ b/src/plugins/MouseGestures/mousegestures.cpp @@ -245,8 +245,9 @@ void MouseGestures::downUpGestured() BrowserWindow* window = view->browserWindow(); if (!window) return; - - window->tabWidget()->duplicateTab(); + + TabWidget* tabWidget = window->tabWidget(); + tabWidget->duplicateTab(tabWidget->currentIndex()); } void MouseGestures::upDownGestured() From 154b43a64498e8dcd1f3d87d601074442aeb65c4 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Fri, 21 Nov 2014 13:04:04 +1300 Subject: [PATCH 4/4] [MouseGestures] Add the info to the UI about Down+Up gesture --- .../MouseGestures/mousegesturessettingsdialog.ui | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/plugins/MouseGestures/mousegesturessettingsdialog.ui b/src/plugins/MouseGestures/mousegesturessettingsdialog.ui index f1565cfd0..d2b0ee441 100644 --- a/src/plugins/MouseGestures/mousegesturessettingsdialog.ui +++ b/src/plugins/MouseGestures/mousegesturessettingsdialog.ui @@ -300,6 +300,20 @@ + + + + :/mousegestures/data/down-up.gif + + + + + + + <b>Duplicate</b><br/>Duplicate current tab + + +