Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1531 from EionRobb/patch-1
Browse files Browse the repository at this point in the history
Add duplicate tab (Down->Up) mouse gesture
  • Loading branch information
nowrep committed Nov 24, 2014
2 parents 25ed40f + 154b43a commit 7ff53e6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/plugins/MouseGestures/mousegestures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand All @@ -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);
Expand Down Expand Up @@ -232,6 +236,20 @@ void MouseGestures::downLeftGestured()
m_view.data()->load(mApp->getWindow()->homepageUrl());
}

void MouseGestures::downUpGestured()
{
TabbedWebView* view = qobject_cast<TabbedWebView*>(m_view.data());
if (!view)
return;

BrowserWindow* window = view->browserWindow();
if (!window)
return;

TabWidget* tabWidget = window->tabWidget();
tabWidget->duplicateTab(tabWidget->currentIndex());
}

void MouseGestures::upDownGestured()
{
if (!m_view) {
Expand Down
1 change: 1 addition & 0 deletions src/plugins/MouseGestures/mousegestures.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private slots:

void downRightGestured();
void downLeftGestured();
void downUpGestured();

void upDownGestured();
void upLeftGestured();
Expand Down
14 changes: 14 additions & 0 deletions src/plugins/MouseGestures/mousegesturessettingsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,20 @@
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_14">
<property name="pixmap">
<pixmap>:/mousegestures/data/down-up.gif</pixmap>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_16">
<property name="text">
<string>&lt;b&gt;Duplicate&lt;/b&gt;&lt;br/&gt;Duplicate current tab</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit 7ff53e6

Please sign in to comment.