diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-29 12:41:39 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-29 12:41:39 +0200 |
commit | 1ef712920d762f9f88393caf1018bd8708c02424 (patch) | |
tree | 56107fd4b2f222b91d321c09dc20a65a8d3f4487 /src/tabbar.cpp | |
parent | Right icon button fix (diff) | |
download | rekonq-1ef712920d762f9f88393caf1018bd8708c02424.tar.xz |
Fixing tab switch behavior.
It seems webkit removed an update on setViewPortSize, letting
our trick about setScrollBarPolicy dangerous (no scrollbar on rendered
pages)
Diffstat (limited to 'src/tabbar.cpp')
-rw-r--r-- | src/tabbar.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
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 (i<count() && tab==-1) + int tabIndex = -1; + while ( i<count() + && tabIndex == -1 + ) { if (tabRect(i).contains(event->pos())) { - 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() ) { |