1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 18:26: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:
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)
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)

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
* New LocationBar completer
* (KDE) Nepomuk integration
* Page previews as tooltip on tabs (like Opera)
* Support for remote Web inspector
* option to save RSS feeds in external reader
* Session manager

View File

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

View File

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

View File

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

View File

@ -35,6 +35,7 @@ TabPreview::TabPreview(QupZilla* mainClass, QWidget* parent)
, p_QupZilla(mainClass)
, m_pixmap(new QLabel)
, m_title(new QLabel)
, m_previewIndex(-1)
, m_animationsEnabled(true)
{
m_pixmap->setAlignment(Qt::AlignHCenter);
@ -63,6 +64,16 @@ TabPreview::TabPreview(QupZilla* mainClass, QWidget* parent)
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)
{
if (webTab->isRestored() && !webTab->isLoading() && !noPixmap) {
@ -102,6 +113,7 @@ void TabPreview::hideAnimated()
void TabPreview::hide()
{
m_previewIndex = -1;
disconnect(m_opacityAnimation, SIGNAL(finished()), this, SLOT(hide()));
QFrame::hide();

View File

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