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

Showing tab previews on ToolTip event now.

- added Alexander Samilov into contributors
This commit is contained in:
nowrep 2012-04-09 19:45:00 +02:00
parent d03700f917
commit 0a50c2d9ef
8 changed files with 36 additions and 20 deletions

View File

@ -5,6 +5,7 @@ David Rosca <nowrep@gmail.com>
Contributors: Contributors:
Mladen Pejaković <pejakm@gmail.com> (webview context menu improvements, speed dial background) Mladen Pejaković <pejakm@gmail.com> (webview context menu improvements, speed dial background)
Alexander Samilov <alexsamilovskih@gmail.com> (tab previews)
Bryan M Dunsmore <dunsmoreb@gmail.com> (opening background tabs, closing window when closing last tab) Bryan M Dunsmore <dunsmoreb@gmail.com> (opening background tabs, closing window when closing last tab)
Mariusz Fik <fisiu@opensuse.org> (fixed tab order in preferences dialog) Mariusz Fik <fisiu@opensuse.org> (fixed tab order in preferences dialog)
Daniele Cocca <jmc@chakra-project.org> (close tabs with middle click, initial work on speed dial) Daniele Cocca <jmc@chakra-project.org> (close tabs with middle click, initial work on speed dial)

1
TODO
View File

@ -10,7 +10,6 @@ The list is not sorted by priority.
* Password Manager: save more than one account for site + input completer * Password Manager: save more than one account for site + input completer
* New LocationBar completer * New LocationBar completer
* (KDE) Nepomuk integration * (KDE) Nepomuk integration
* Page previews as tooltip on tabs (like Opera)
* Support for remote Web inspector * Support for remote Web inspector
* option to save RSS feeds in external reader * option to save RSS feeds in external reader
* Session manager * Session manager

View File

@ -203,6 +203,7 @@ QString QupZillaSchemeReply::aboutPage()
aPage.replace("%CONTRIBUTORS%", tr("Contributors")); aPage.replace("%CONTRIBUTORS%", tr("Contributors"));
aPage.replace("%CONTRIBUTORS-TEXT%", aPage.replace("%CONTRIBUTORS-TEXT%",
authorString("Mladen Pejaković", "pejakm@gmail.com") + "<br/>" + authorString("Mladen Pejaković", "pejakm@gmail.com") + "<br/>" +
authorString("Alexander Samilov", "alexsamilovskih@gmail.com") + "<br/>" +
authorString("Bryan M Dunsmore", "dunsmoreb@gmail.com") + "<br/>" + authorString("Bryan M Dunsmore", "dunsmoreb@gmail.com") + "<br/>" +
authorString("Mariusz Fik", "fisiu@opensuse.org") + "<br/>" + authorString("Mariusz Fik", "fisiu@opensuse.org") + "<br/>" +
authorString("Jan Rajnoha", "honza.rajny@hotmail.com") + "<br/>" + authorString("Jan Rajnoha", "honza.rajny@hotmail.com") + "<br/>" +

View File

@ -79,6 +79,7 @@ void AboutDialog::showAuthors()
m_authorsHtml += tr("<p><b>Main developer:</b><br/>%1 &lt;%2&gt;</p>").arg(QupZilla::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>"); m_authorsHtml += tr("<p><b>Main developer:</b><br/>%1 &lt;%2&gt;</p>").arg(QupZilla::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>");
m_authorsHtml += tr("<p><b>Contributors:</b><br/>%1</p>").arg( m_authorsHtml += tr("<p><b>Contributors:</b><br/>%1</p>").arg(
QString::fromUtf8("Mladen Pejaković<br/>" QString::fromUtf8("Mladen Pejaković<br/>"
"Alexander Samilov<br/>"
"Bryan M Dunsmore<br/>" "Bryan M Dunsmore<br/>"
"Mariusz Fik<br/>" "Mariusz Fik<br/>"
"Jan Rajnoha<br/>" "Jan Rajnoha<br/>"

View File

@ -50,7 +50,6 @@ TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget)
, m_tabPreview(new TabPreview(mainClass, tabWidget)) , m_tabPreview(new TabPreview(mainClass, tabWidget))
, m_clickedTab(0) , m_clickedTab(0)
, m_pinnedTabsCount(0) , m_pinnedTabsCount(0)
, m_currentTabPreview(-1)
, m_normalTabWidth(0) , m_normalTabWidth(0)
, m_lastTabWidth(0) , m_lastTabWidth(0)
, m_adjustingLastTab(false) , m_adjustingLastTab(false)
@ -119,7 +118,7 @@ void TabBar::setVisible(bool visible)
emit hideButtons(); emit hideButtons();
} }
m_tabPreview->setVisible(false); hideTabPreview(false);
QTabBar::setVisible(visible); QTabBar::setVisible(visible);
} }
@ -360,14 +359,14 @@ int TabBar::normalTabsCount()
void TabBar::showTabPreview() void TabBar::showTabPreview()
{ {
WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(m_currentTabPreview)); WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(m_tabPreview->previewIndex()));
if (!webTab) { if (!webTab) {
return; return;
} }
m_tabPreviewTimer->stop(); m_tabPreviewTimer->stop();
m_tabPreview->setWebTab(webTab, m_currentTabPreview == currentIndex()); m_tabPreview->setWebTab(webTab, m_tabPreview->previewIndex() == currentIndex());
m_tabPreview->showOnRect(tabRect(m_currentTabPreview)); m_tabPreview->showOnRect(tabRect(m_tabPreview->previewIndex()));
} }
void TabBar::hideTabPreview(bool delayed) void TabBar::hideTabPreview(bool delayed)
@ -378,8 +377,6 @@ void TabBar::hideTabPreview(bool delayed)
else { else {
m_tabPreview->hideAnimated(); m_tabPreview->hideAnimated();
} }
m_currentTabPreview = -1;
} }
void TabBar::mouseDoubleClickEvent(QMouseEvent* event) void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
@ -398,6 +395,8 @@ void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
void TabBar::mousePressEvent(QMouseEvent* event) void TabBar::mousePressEvent(QMouseEvent* event)
{ {
hideTabPreview(false);
if (mApp->plugins()->processMousePress(Qz::ON_TabBar, this, event)) { if (mApp->plugins()->processMousePress(Qz::ON_TabBar, this, event)) {
return; return;
} }
@ -430,14 +429,11 @@ void TabBar::mouseMoveEvent(QMouseEvent* event)
const int tab = tabAt(event->pos()); const int tab = tabAt(event->pos());
if (tab != -1 && tab != m_currentTabPreview && event->buttons() == Qt::NoButton && m_dragStartPosition.isNull()) { if (tab != -1 && tab != m_tabPreview->previewIndex() && event->buttons() == Qt::NoButton && m_dragStartPosition.isNull()) {
m_currentTabPreview = tab; m_tabPreview->setPreviewIndex(tab);
if (m_tabPreview->isVisible()) { if (m_tabPreview->isVisible()) {
showTabPreview(); showTabPreview();
} }
else {
QTimer::singleShot(200, this, SLOT(showTabPreview()));
}
} }
QTabBar::mouseMoveEvent(event); QTabBar::mouseMoveEvent(event);
@ -473,11 +469,16 @@ void TabBar::mouseReleaseEvent(QMouseEvent* event)
QTabBar::mouseReleaseEvent(event); QTabBar::mouseReleaseEvent(event);
} }
void TabBar::leaveEvent(QEvent* event) bool TabBar::event(QEvent *event)
{ {
hideTabPreview(); if (event->type() == QEvent::Leave) {
hideTabPreview();
}
else if (event->type() == QEvent::ToolTip && !m_tabPreview->isVisible()) {
showTabPreview();
}
QTabBar::leaveEvent(event); return QTabBar::event(event);
} }
void TabBar::wheelEvent(QWheelEvent* event) void TabBar::wheelEvent(QWheelEvent* event)

View File

@ -59,8 +59,6 @@ signals:
void showButtons(); void showButtons();
void hideButtons(); void hideButtons();
public slots:
private slots: private slots:
void currentTabChanged(int index); void currentTabChanged(int index);
void pinnedTabAdded(); void pinnedTabAdded();
@ -84,8 +82,8 @@ private:
void mousePressEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event); void mouseMoveEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event); void mouseReleaseEvent(QMouseEvent* event);
void leaveEvent(QEvent* event);
void wheelEvent(QWheelEvent* event); void wheelEvent(QWheelEvent* event);
bool event(QEvent *event);
void dragEnterEvent(QDragEnterEvent* event); void dragEnterEvent(QDragEnterEvent* event);
void dropEvent(QDropEvent* event); void dropEvent(QDropEvent* event);
@ -105,7 +103,6 @@ private:
int m_clickedTab; int m_clickedTab;
int m_pinnedTabsCount; int m_pinnedTabsCount;
int m_currentTabPreview;
int m_normalTabWidth; int m_normalTabWidth;
int m_lastTabWidth; int m_lastTabWidth;

View File

@ -35,6 +35,7 @@ TabPreview::TabPreview(QupZilla* mainClass, QWidget* parent)
, p_QupZilla(mainClass) , p_QupZilla(mainClass)
, m_pixmap(new QLabel) , m_pixmap(new QLabel)
, m_title(new QLabel) , m_title(new QLabel)
, m_previewIndex(-1)
, m_animationsEnabled(true) , m_animationsEnabled(true)
{ {
m_pixmap->setAlignment(Qt::AlignHCenter); m_pixmap->setAlignment(Qt::AlignHCenter);
@ -63,6 +64,16 @@ TabPreview::TabPreview(QupZilla* mainClass, QWidget* parent)
m_opacityEffect->setOpacity(0.0); m_opacityEffect->setOpacity(0.0);
} }
int TabPreview::previewIndex()
{
return m_previewIndex;
}
void TabPreview::setPreviewIndex(int index)
{
m_previewIndex = index;
}
void TabPreview::setWebTab(WebTab* webTab, bool noPixmap) void TabPreview::setWebTab(WebTab* webTab, bool noPixmap)
{ {
if (webTab->isRestored() && !webTab->isLoading() && !noPixmap) { if (webTab->isRestored() && !webTab->isLoading() && !noPixmap) {
@ -102,6 +113,7 @@ void TabPreview::hideAnimated()
void TabPreview::hide() void TabPreview::hide()
{ {
m_previewIndex = -1;
disconnect(m_opacityAnimation, SIGNAL(finished()), this, SLOT(hide())); disconnect(m_opacityAnimation, SIGNAL(finished()), this, SLOT(hide()));
QFrame::hide(); QFrame::hide();

View File

@ -37,6 +37,9 @@ public:
void setWebTab(WebTab* webTab, bool noPixmap); void setWebTab(WebTab* webTab, bool noPixmap);
void showOnRect(const QRect &rect); void showOnRect(const QRect &rect);
int previewIndex();
void setPreviewIndex(int index);
void setAnimationsEnabled(bool enabled); void setAnimationsEnabled(bool enabled);
public slots: public slots:
@ -57,6 +60,7 @@ private:
QLabel* m_pixmap; QLabel* m_pixmap;
QLabel* m_title; QLabel* m_title;
int m_previewIndex;
bool m_animationsEnabled; bool m_animationsEnabled;
QPropertyAnimation* m_animation; QPropertyAnimation* m_animation;
QPropertyAnimation* m_opacityAnimation; QPropertyAnimation* m_opacityAnimation;