mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Track parent tab for WebTab when opening new tabs
This commit is contained in:
parent
e44877d4c7
commit
5b7653188b
@ -623,6 +623,9 @@ QWebEnginePage* WebPage::createWindow(QWebEnginePage::WebWindowType type)
|
||||
int index = window->tabWidget()->addView(QUrl(), pos);
|
||||
TabbedWebView* view = window->weView(index);
|
||||
view->setPage(new WebPage);
|
||||
if (tView) {
|
||||
view->webTab()->setParentTab(tView->webTab());
|
||||
}
|
||||
// Workaround focus issue when creating tab
|
||||
if (pos.testFlag(Qz::NT_SelectedTab)) {
|
||||
QPointer<TabbedWebView> pview = view;
|
||||
|
@ -165,8 +165,10 @@ void TabbedWebView::loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags
|
||||
{
|
||||
if (m_window) {
|
||||
int index = m_window->tabWidget()->addView(QUrl(), position);
|
||||
m_window->weView(index)->webTab()->locationBar()->showUrl(req.url());
|
||||
m_window->weView(index)->load(req);
|
||||
TabbedWebView *view = m_window->weView(index);
|
||||
view->webTab()->setParentTab(webTab());
|
||||
view->webTab()->locationBar()->showUrl(req.url());
|
||||
view->load(req);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,6 +284,9 @@ void WebTab::detach()
|
||||
Q_ASSERT(m_window);
|
||||
Q_ASSERT(m_tabBar);
|
||||
|
||||
// Remove parent tab
|
||||
setParentTab(nullptr);
|
||||
|
||||
// Remove icon from tab
|
||||
m_tabBar->setTabButton(tabIndex(), m_tabBar->iconButtonPosition(), nullptr);
|
||||
m_tabIcon->setParent(this);
|
||||
|
Loading…
Reference in New Issue
Block a user