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

Middle mouse click on free space on tabbar now open a new tab

This commit is contained in:
nowrep 2011-10-17 23:34:57 +02:00
parent 4ed8026bfa
commit 12fb69a2fd
2 changed files with 6 additions and 5 deletions

View File

@ -634,6 +634,7 @@ void QupZilla::aboutToShowToolsMenu()
m_menuTools->addAction(QIcon(":/icons/menu/rss.png"), tr("RSS &Reader"), this, SLOT(showRSSManager())); m_menuTools->addAction(QIcon(":/icons/menu/rss.png"), tr("RSS &Reader"), this, SLOT(showRSSManager()));
m_menuTools->addAction(QIcon::fromTheme("edit-clear"), tr("Clear Recent &History"), this, SLOT(showClearPrivateData())); m_menuTools->addAction(QIcon::fromTheme("edit-clear"), tr("Clear Recent &History"), this, SLOT(showClearPrivateData()));
m_actionPrivateBrowsing = new QAction(tr("&Private Browsing"), this); m_actionPrivateBrowsing = new QAction(tr("&Private Browsing"), this);
m_actionPrivateBrowsing->setShortcut(QKeySequence("Ctrl+Shift+P"));
m_actionPrivateBrowsing->setCheckable(true); m_actionPrivateBrowsing->setCheckable(true);
m_actionPrivateBrowsing->setChecked(mApp->webSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)); m_actionPrivateBrowsing->setChecked(mApp->webSettings()->testAttribute(QWebSettings::PrivateBrowsingEnabled));
connect(m_actionPrivateBrowsing, SIGNAL(triggered(bool)), this, SLOT(startPrivate(bool))); connect(m_actionPrivateBrowsing, SIGNAL(triggered(bool)), this, SLOT(startPrivate(bool)));

View File

@ -233,13 +233,13 @@ void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
void TabBar::mousePressEvent(QMouseEvent* event) void TabBar::mousePressEvent(QMouseEvent* event)
{ {
TabWidget* tabWidget = qobject_cast<TabWidget*>(parentWidget());
if (!tabWidget)
return;
int id = tabAt(event->pos()); int id = tabAt(event->pos());
if (id != -1 && event->buttons() == Qt::MiddleButton) { if (id != -1 && event->buttons() == Qt::MiddleButton) {
tabWidget->closeTab(id); m_tabWidget->closeTab(id);
return;
}
if (id == -1 && event->buttons() == Qt::MiddleButton) {
m_tabWidget->addView(QUrl(), tr("New tab"), TabWidget::NewSelectedTab, true);
return; return;
} }
QTabBar::mousePressEvent(event); QTabBar::mousePressEvent(event);