mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
Vertical Tabs: Add child tab with middle click on "New Tab" button
Summary: BUG: 393656 Reviewers: #falkon, drosca Reviewed By: #falkon, drosca Subscribers: drosca, falkon Tags: #falkon Differential Revision: https://phabricator.kde.org/D21664
This commit is contained in:
parent
493421dd84
commit
dfb3d2357d
@ -59,6 +59,7 @@ VerticalTabsWidget::VerticalTabsWidget(BrowserWindow *window)
|
|||||||
buttonAddTab->setIcon(QIcon::fromTheme(QSL("list-add")));
|
buttonAddTab->setIcon(QIcon::fromTheme(QSL("list-add")));
|
||||||
buttonAddTab->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
buttonAddTab->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
connect(buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab);
|
connect(buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab);
|
||||||
|
connect(buttonAddTab, &ToolButton::middleMouseClicked, this, &VerticalTabsWidget::addChildTab);
|
||||||
|
|
||||||
m_groupMenu = new QMenu(this);
|
m_groupMenu = new QMenu(this);
|
||||||
buttonAddTab->setMenu(m_groupMenu);
|
buttonAddTab->setMenu(m_groupMenu);
|
||||||
@ -201,3 +202,10 @@ void VerticalTabsWidget::updateGroupMenu()
|
|||||||
m_window->tabWidget()->addView(QUrl(QSL("extension://verticaltabs/group")), Qz::NT_SelectedTab);
|
m_window->tabWidget()->addView(QUrl(QSL("extension://verticaltabs/group")), Qz::NT_SelectedTab);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VerticalTabsWidget::addChildTab()
|
||||||
|
{
|
||||||
|
WebTab *tab = m_window->tabWidget()->webTab();
|
||||||
|
m_window->addTab();
|
||||||
|
m_window->tabWidget()->webTab()->setParentTab(tab);
|
||||||
|
}
|
||||||
|
@ -43,6 +43,8 @@ public:
|
|||||||
void switchToNextTab();
|
void switchToNextTab();
|
||||||
void switchToPreviousTab();
|
void switchToPreviousTab();
|
||||||
|
|
||||||
|
void addChildTab();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebTab *nextTab() const;
|
WebTab *nextTab() const;
|
||||||
WebTab *previousTab() const;
|
WebTab *previousTab() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user