From 1ef712920d762f9f88393caf1018bd8708c02424 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 29 Apr 2010 12:41:39 +0200 Subject: Fixing tab switch behavior. It seems webkit removed an update on setViewPortSize, letting our trick about setScrollBarPolicy dangerous (no scrollbar on rendered pages) --- src/tabbar.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/tabbar.cpp') diff --git a/src/tabbar.cpp b/src/tabbar.cpp index a2f269c4..7e10a196 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -197,25 +197,31 @@ void TabBar::mouseMoveEvent(QMouseEvent *event) { //Find the tab under the mouse int i = 0; - int tab = -1; - while (ipos())) { - tab = i; + tabIndex = i; } i++; } - //if found and not the current tab then show tab preview - if (tab != -1 && tab != currentIndex() && m_currentTabPreview != tab && event->buttons() == Qt::NoButton) + // if found and not the current tab then show tab preview + if ( tabIndex != -1 + && tabIndex != currentIndex() + && m_currentTabPreview != tabIndex + && event->buttons() == Qt::NoButton + ) { - showTabPreview(tab); - m_currentTabPreview = tab; + showTabPreview(tabIndex); + m_currentTabPreview = tabIndex; } - //if current tab or not found then hide previous tab preview - if (tab==currentIndex() || tab==-1) + // if current tab or not found then hide previous tab preview + if (tabIndex == currentIndex() || tabIndex == -1) { if ( !m_previewPopup.isNull() ) { -- cgit v1.2.1