mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Fix restoring zoom level of tabs
This commit is contained in:
parent
e9d1771114
commit
e15bcc9215
@ -679,7 +679,7 @@ int TabWidget::duplicateTab(int index)
|
||||
WebTab* webTab = weTab(index);
|
||||
|
||||
int id = addView(QUrl(), webTab->title(), Qz::NT_CleanNotSelectedTab);
|
||||
weTab(id)->p_restoreTab(webTab->url(), webTab->historyData());
|
||||
weTab(id)->p_restoreTab(webTab->url(), webTab->historyData(), webTab->zoomLevel());
|
||||
|
||||
return id;
|
||||
}
|
||||
@ -710,8 +710,7 @@ void TabWidget::restoreClosedTab(QObject* obj)
|
||||
|
||||
int index = addView(QUrl(), tab.title, Qz::NT_CleanSelectedTab, false, tab.position);
|
||||
WebTab* webTab = weTab(index);
|
||||
webTab->setZoomLevel(tab.zoomLevel);
|
||||
webTab->p_restoreTab(tab.url, tab.history);
|
||||
webTab->p_restoreTab(tab.url, tab.history, tab.zoomLevel);
|
||||
|
||||
updateClosedTabsButton();
|
||||
}
|
||||
@ -727,7 +726,7 @@ void TabWidget::restoreAllClosedTabs()
|
||||
foreach (const ClosedTabsManager::Tab &tab, closedTabs) {
|
||||
int index = addView(QUrl(), tab.title, Qz::NT_CleanSelectedTab);
|
||||
WebTab* webTab = weTab(index);
|
||||
webTab->p_restoreTab(tab.url, tab.history);
|
||||
webTab->p_restoreTab(tab.url, tab.history, tab.zoomLevel);
|
||||
}
|
||||
|
||||
clearClosedTabsList();
|
||||
@ -843,8 +842,7 @@ void TabWidget::restorePinnedTabs()
|
||||
|
||||
if (!historyState.isEmpty()) {
|
||||
addedIndex = addView(QUrl(), Qz::NT_CleanSelectedTab, false, true);
|
||||
|
||||
weTab(addedIndex)->p_restoreTab(url, historyState);
|
||||
weTab(addedIndex)->p_restoreTab(url, historyState, 6);
|
||||
}
|
||||
else {
|
||||
addedIndex = addView(url, tr("New tab"), Qz::NT_SelectedTab, false, -1, true);
|
||||
|
@ -357,16 +357,17 @@ void WebTab::restoreTab(const WebTab::SavedTab &tab)
|
||||
}
|
||||
}
|
||||
|
||||
void WebTab::p_restoreTab(const QUrl &url, const QByteArray &history)
|
||||
void WebTab::p_restoreTab(const QUrl &url, const QByteArray &history, int zoomLevel)
|
||||
{
|
||||
m_webView->load(url);
|
||||
m_webView->restoreHistory(history);
|
||||
m_webView->setZoomLevel(zoomLevel);
|
||||
m_webView->setFocus();
|
||||
}
|
||||
|
||||
void WebTab::p_restoreTab(const WebTab::SavedTab &tab)
|
||||
{
|
||||
p_restoreTab(tab.url, tab.history);
|
||||
p_restoreTab(tab.url, tab.history, tab.zoomLevel);
|
||||
}
|
||||
|
||||
void WebTab::showNotification(QWidget* notif)
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
bool isRestored() const;
|
||||
void restoreTab(const SavedTab &tab);
|
||||
void p_restoreTab(const SavedTab &tab);
|
||||
void p_restoreTab(const QUrl &url, const QByteArray &history);
|
||||
void p_restoreTab(const QUrl &url, const QByteArray &history, int zoomLevel);
|
||||
|
||||
private slots:
|
||||
void showNotification(QWidget* notif);
|
||||
|
Loading…
Reference in New Issue
Block a user