1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

[TabPreviews] Fix some small tab preview issues with ComboTabBar

This commit is contained in:
nowrep 2013-12-24 00:01:35 +01:00
parent e8bbe53edb
commit 3bfa8cecaa

View File

@ -494,6 +494,7 @@ void TabBar::showTabPreview()
m_tabPreviewTimer->stop();
m_tabPreview->setWebTab(webTab, m_tabPreview->previewIndex() == currentIndex());
QRect r(tabRect(m_tabPreview->previewIndex()));
r.setTopLeft(mapTo(p_QupZilla, r.topLeft()));
r.setBottomRight(mapTo(p_QupZilla, r.bottomRight()));
@ -589,15 +590,12 @@ void TabBar::mouseMoveEvent(QMouseEvent* event)
}
// Tab Preview
const int tab = tabAt(event->pos());
if (tab != -1 && tab != m_tabPreview->previewIndex() && event->buttons() == Qt::NoButton && m_dragStartPosition.isNull()) {
m_tabPreview->setPreviewIndex(tab);
if (m_tabPreview->isVisible()) {
showTabPreview();
}
}
ComboTabBar::mouseMoveEvent(event);
}
@ -642,7 +640,10 @@ bool TabBar::event(QEvent* event)
case QEvent::ToolTip:
if (m_showTabPreviews) {
QHelpEvent* ev = static_cast<QHelpEvent*>(event);
if (tabAt(ev->pos()) != -1 && !m_tabPreview->isVisible() && m_dragStartPosition.isNull()) {
int index = tabAt(ev->pos());
if (index != -1 && !m_tabPreview->isVisible() && m_dragStartPosition.isNull()) {
m_tabPreview->setPreviewIndex(index);
showTabPreview();
}
return true;