From 5873ed48fdb73e1481fb997cc4503a0ce8d28dbf Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 7 Feb 2017 09:29:21 +0100 Subject: [PATCH] TabIcon: Hide icon immediately when url is empty or has qupzilla: scheme --- src/lib/tabwidget/tabicon.cpp | 6 +++++- src/lib/webtab/webtab.cpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/tabwidget/tabicon.cpp b/src/lib/tabwidget/tabicon.cpp index a3563fdfa..33d8b3bb7 100644 --- a/src/lib/tabwidget/tabicon.cpp +++ b/src/lib/tabwidget/tabicon.cpp @@ -90,7 +90,11 @@ void TabIcon::updateIcon() { m_sitePixmap = m_tab->icon(/*allowNull*/ true).pixmap(16); if (m_sitePixmap.isNull()) { - m_hideTimer->start(); + if (m_tab->url().isEmpty() || m_tab->url().scheme() == QL1S("qupzilla")) { + hide(); + } else { + m_hideTimer->start(); + } } else { show(); } diff --git a/src/lib/webtab/webtab.cpp b/src/lib/webtab/webtab.cpp index 84345d32b..2edd83223 100644 --- a/src/lib/webtab/webtab.cpp +++ b/src/lib/webtab/webtab.cpp @@ -291,8 +291,9 @@ void WebTab::attach(BrowserWindow* window) m_tabBar = m_window->tabWidget()->tabBar(); m_webView->setBrowserWindow(m_window); - m_tabBar->setTabButton(tabIndex(), m_tabBar->iconButtonPosition(), m_tabIcon); m_tabBar->setTabText(tabIndex(), title()); + m_tabBar->setTabButton(tabIndex(), m_tabBar->iconButtonPosition(), m_tabIcon); + m_tabIcon->updateIcon(); } void WebTab::setHistoryData(const QByteArray &data)