1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

[TabsOnTop] Fixed flickering when closing tab.

It only occured when closing tab and going to tab that hasn't
been loaded yet (don't load tabs until selected)
This commit is contained in:
nowrep 2013-02-11 09:51:22 +01:00
parent 0133886b06
commit 38c4d347c9
2 changed files with 9 additions and 3 deletions

View File

@ -30,6 +30,7 @@
#include <QWebFrame> #include <QWebFrame>
#include <QLabel> #include <QLabel>
#include <QStyle> #include <QStyle>
#include <QTimer>
WebTab::SavedTab::SavedTab(WebTab* webTab) WebTab::SavedTab::SavedTab(WebTab* webTab)
{ {
@ -110,9 +111,7 @@ TabbedWebView* WebTab::view() const
void WebTab::setCurrentTab() void WebTab::setCurrentTab()
{ {
if (!isRestored()) { if (!isRestored()) {
p_restoreTab(m_savedTab); QTimer::singleShot(0, this, SLOT(slotRestore()));
m_savedTab.clear();
} }
} }
@ -305,6 +304,12 @@ void WebTab::showNotification(QWidget* notif)
notif->show(); notif->show();
} }
void WebTab::slotRestore()
{
p_restoreTab(m_savedTab);
m_savedTab.clear();
}
int WebTab::tabIndex() const int WebTab::tabIndex() const
{ {
return m_view->tabIndex(); return m_view->tabIndex();

View File

@ -98,6 +98,7 @@ public:
private slots: private slots:
void showNotification(QWidget* notif); void showNotification(QWidget* notif);
void slotRestore();
private: private:
QupZilla* p_QupZilla; QupZilla* p_QupZilla;