1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

[Win] another solution,isChangingTab() removed from last commit.

This commit is contained in:
S. Razi Alavizadeh 2013-02-16 16:02:33 +03:30
parent c4b98d4a7a
commit 6a4c45c0ad
3 changed files with 18 additions and 10 deletions

View File

@ -774,6 +774,7 @@ void QupZilla::loadSettings()
m_navigationBar->installEventFilter(this); m_navigationBar->installEventFilter(this);
m_bookmarksToolbar->installEventFilter(this); m_bookmarksToolbar->installEventFilter(this);
statusBar()->installEventFilter(this); statusBar()->installEventFilter(this);
m_navigationContainer->installEventFilter(this);
} }
#endif #endif
} }
@ -2345,9 +2346,7 @@ bool QupZilla::nativeEvent(const QByteArray &eventType, void* _message, long* re
void QupZilla::applyBlurToMainWindow(bool force) void QupZilla::applyBlurToMainWindow(bool force)
{ {
if (!force && (m_actionShowFullScreen->isChecked() if (!force && (m_actionShowFullScreen->isChecked() || !m_usingTransparentBackground)) {
|| !m_usingTransparentBackground
|| m_tabWidget->getTabBar()->isChangingTab())) {
return; return;
} }
int topMargin = 0; int topMargin = 0;
@ -2389,10 +2388,23 @@ void QupZilla::applyBlurToMainWindow(bool force)
bool QupZilla::eventFilter(QObject* object, QEvent* event) bool QupZilla::eventFilter(QObject* object, QEvent* event)
{ {
switch (event->type()) { switch (event->type()) {
case QEvent::DeferredDelete:
case QEvent::Show:
case QEvent::Hide: case QEvent::Hide:
if (object == m_navigationContainer) {
m_navigationBar->removeEventFilter(this);
m_bookmarksToolbar->removeEventFilter(this);
break;
}
case QEvent::Show:
if (object == m_navigationContainer) {
m_navigationBar->installEventFilter(this);
m_bookmarksToolbar->installEventFilter(this);
break;
}
case QEvent::Resize: case QEvent::Resize:
case QEvent::DeferredDelete:
if (object == m_navigationContainer) {
break;
}
applyBlurToMainWindow(); applyBlurToMainWindow();
break; break;
default: default:

View File

@ -44,7 +44,6 @@ TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget)
, m_tabWidget(tabWidget) , m_tabWidget(tabWidget)
, m_tabPreview(new TabPreview(mainClass, tabWidget)) , m_tabPreview(new TabPreview(mainClass, tabWidget))
, m_showTabPreviews(false) , m_showTabPreviews(false)
, m_isChangingTab(false)
, m_clickedTab(0) , m_clickedTab(0)
, m_pinnedTabsCount(0) , m_pinnedTabsCount(0)
, m_normalTabWidth(0) , m_normalTabWidth(0)
@ -400,14 +399,13 @@ void TabBar::currentTabChanged(int index)
if (!validIndex(index)) { if (!validIndex(index)) {
return; return;
} }
m_isChangingTab = true;
hideTabPreview(false); hideTabPreview(false);
showCloseButton(index); showCloseButton(index);
hideCloseButton(m_tabWidget->lastTabIndex()); hideCloseButton(m_tabWidget->lastTabIndex());
m_tabWidget->currentTabChanged(index); m_tabWidget->currentTabChanged(index);
m_isChangingTab = false;
} }
void TabBar::bookmarkTab() void TabBar::bookmarkTab()

View File

@ -42,7 +42,6 @@ public:
int pinnedTabsCount(); int pinnedTabsCount();
int normalTabsCount(); int normalTabsCount();
bool isChangingTab() { return m_isChangingTab; }
void updatePinnedTabCloseButton(int index); void updatePinnedTabCloseButton(int index);
void disconnectObjects(); void disconnectObjects();
@ -106,7 +105,6 @@ private:
QTimer* m_tabPreviewTimer; QTimer* m_tabPreviewTimer;
bool m_showTabPreviews; bool m_showTabPreviews;
bool m_isChangingTab;
int m_clickedTab; int m_clickedTab;
int m_pinnedTabsCount; int m_pinnedTabsCount;