1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

TabManager: Use single click to switch between tabs

This commit is contained in:
srazi 2017-04-05 19:55:01 +04:30
parent 755ec16598
commit 56c737d836
2 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ TabManagerWidget::TabManagerWidget(BrowserWindow* mainClass, QWidget* parent, bo
connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(filterBarClosed()));
connect(ui->filterBar, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
connect(ui->treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClick(QTreeWidgetItem*,int)));
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onItemActivated(QTreeWidgetItem*,int)));
connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
}
@ -201,7 +201,7 @@ void TabManagerWidget::refreshTree()
m_waitForRefresh = false;
}
void TabManagerWidget::itemDoubleClick(QTreeWidgetItem* item, int)
void TabManagerWidget::onItemActivated(QTreeWidgetItem* item, int)
{
if (!item) {
return;
@ -345,7 +345,7 @@ bool TabManagerWidget::eventFilter(QObject* obj, QEvent* event)
if (obj == ui->treeWidget) {
// switch to tab/window on enter
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
itemDoubleClick(ui->treeWidget->currentItem(), 0);
onItemActivated(ui->treeWidget->currentItem(), 0);
return QObject::eventFilter(obj, event);
}

View File

@ -91,7 +91,7 @@ private:
private slots:
void refreshTree();
void processActions();
void itemDoubleClick(QTreeWidgetItem* item, int);
void onItemActivated(QTreeWidgetItem* item, int);
bool isTabSelected();
void customContextMenuRequested(const QPoint &pos);
void filterChanged(const QString &filter, bool force = false);