diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tabbar.cpp | 24 | ||||
-rw-r--r-- | src/tabbar.h | 4 | ||||
-rw-r--r-- | src/websnap.cpp | 12 |
3 files changed, 25 insertions, 15 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() ) { diff --git a/src/tabbar.h b/src/tabbar.h index 97c320fc..fd325b66 100644 --- a/src/tabbar.h +++ b/src/tabbar.h @@ -61,8 +61,6 @@ public: TabBar(QWidget *parent); ~TabBar(); - void showTabPreview(int tab); - signals: void cloneTab(int index); void closeTab(int index); @@ -94,6 +92,8 @@ private slots: void emptyAreaContextMenu(const QPoint &); private: + void showTabPreview(int tab); + friend class MainView; /** diff --git a/src/websnap.cpp b/src/websnap.cpp index 6be7314e..af52b592 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -72,10 +72,14 @@ void WebSnap::load() // You are playing with fire.. QPixmap WebSnap::renderPreview(const QWebPage &page, int w, int h) { + // NOTE + // it seems no way to enable/disable scrollbars in new QtWebKit's + // and this is affecting tabbed browsing + // prepare page - page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); - page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); QSize oldSize = page.viewportSize(); +// page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); +// page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); // find the best size QSize size; @@ -98,8 +102,8 @@ QPixmap WebSnap::renderPreview(const QWebPage &page, int w, int h) pageImage = pageImage.scaled(w, h, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); // restore page settings - page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded); - page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded); +// page.mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded); +// page.mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded); page.setViewportSize(oldSize); QPixmap pm = QPixmap::fromImage(pageImage); |