1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Add duplicate tab (Down->Up) mouse gesture

This commit is contained in:
Eion Robb 2014-11-20 13:32:31 +13:00
parent b1c12998c7
commit 00812af136

View File

@ -70,6 +70,9 @@ void MouseGestures::initFilter()
QjtMouseGesture* downLeftGesture = new QjtMouseGesture(DirectionList() << Down << Left, m_filter); QjtMouseGesture* downLeftGesture = new QjtMouseGesture(DirectionList() << Down << Left, m_filter);
connect(downLeftGesture, SIGNAL(gestured()), this, SLOT(downLeftGestured())); 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); QjtMouseGesture* upDownGesture = new QjtMouseGesture(DirectionList() << Up << Down, m_filter);
connect(upDownGesture, SIGNAL(gestured()), this, SLOT(upDownGestured())); connect(upDownGesture, SIGNAL(gestured()), this, SLOT(upDownGestured()));
@ -86,6 +89,7 @@ void MouseGestures::initFilter()
m_filter->addGesture(downRightGesture); m_filter->addGesture(downRightGesture);
m_filter->addGesture(downLeftGesture); m_filter->addGesture(downLeftGesture);
m_filter->addGesture(downUpGesture);
m_filter->addGesture(upDownGesture); m_filter->addGesture(upDownGesture);
m_filter->addGesture(upLeftGesture); m_filter->addGesture(upLeftGesture);
m_filter->addGesture(upRightGesture); m_filter->addGesture(upRightGesture);
@ -232,6 +236,19 @@ void MouseGestures::downLeftGestured()
m_view.data()->load(mApp->getWindow()->homepageUrl()); 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;
window->tabWidget()->duplicateTab();
}
void MouseGestures::upDownGestured() void MouseGestures::upDownGestured()
{ {
if (!m_view) { if (!m_view) {