summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-02-10 19:13:11 +0100
committerAndrea Diamantini <adjam7@gmail.com>2011-02-10 19:13:36 +0100
commitb08d50a8abd0ce4463ec99bb754986f640cf28fa (patch)
treef51c6f4a7725fc37b23b9ee2bcdbf6781f7896be /src
parenthighlights inactive tabs if title changes (diff)
downloadrekonq-b08d50a8abd0ce4463ec99bb754986f640cf28fa.tar.xz
Revert "highlights inactive tabs if title changes"
It seems that while me and pierre (with our lazy eyes) found this good, Benjamin found some glitches to fix :) Waiting for a better patch... This reverts commit fc669e0bf82018baa70a8b59529e1a571d5ad820.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/mainview.cpp6
-rw-r--r--src/tabbar.cpp45
-rw-r--r--src/tabbar.h7
-rw-r--r--src/tabhighlighteffect.cpp77
-rw-r--r--src/tabhighlighteffect.h52
6 files changed, 2 insertions, 186 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e0f75a04..7f9fe19f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,7 +23,6 @@ SET( rekonq_KDEINIT_SRCS
protocolhandler.cpp
sessionmanager.cpp
tabbar.cpp
- tabhighlighteffect.cpp
urlfilterproxymodel.cpp
urlpanel.cpp
walletbar.cpp
diff --git a/src/mainview.cpp b/src/mainview.cpp
index af7a9511..66c86bc5 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -266,8 +266,6 @@ void MainView::currentChanged(int index)
m_widgetBar->currentWidget()->setFocus();
else
tab->view()->setFocus();
-
- tabBar()->setTabHighlighted(index, false);
}
@@ -576,10 +574,6 @@ void MainView::webViewTitleChanged(const QString &title)
{
emit currentTitle(viewTitle);
}
- else
- {
- tabBar()->setTabHighlighted(index, true);
- }
Application::historyManager()->updateHistoryEntry(tab->url(), tabTitle);
if (ReKonfig::hoveringTabOption() == 1)
tabBar()->setTabToolTip(index, tabTitle.remove('&'));
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 655b93c0..7a8419a3 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -41,22 +41,18 @@
#include "webpage.h"
#include "webtab.h"
#include "websnap.h"
-#include "tabhighlighteffect.h"
// KDE Includes
#include <KActionMenu>
#include <KMenu>
#include <KPassivePopup>
#include <KToolBar>
-#include <KColorScheme>
// Qt Includes
#include <QtGui/QLabel>
#include <QtGui/QLayout>
#include <QtGui/QMouseEvent>
#include <QtGui/QToolButton>
-#include <QPropertyAnimation>
-#include <QStyleOptionFrameV3>
#define BASE_WIDTH_DIVISOR 4
@@ -68,7 +64,6 @@ TabBar::TabBar(QWidget *parent)
, m_actualIndex(-1)
, m_currentTabPreviewIndex(-1)
, m_isFirstTimeOnTab(true)
- , m_tabHighlightEffect(new TabHighlightEffect(this))
{
setElideMode(Qt::ElideRight);
@@ -80,8 +75,6 @@ TabBar::TabBar(QWidget *parent)
connect(this, SIGNAL(contextMenu(int, const QPoint &)), this, SLOT(contextMenu(int, const QPoint &)));
connect(this, SIGNAL(emptyAreaContextMenu(const QPoint &)), this, SLOT(emptyAreaContextMenu(const QPoint &)));
-
- setGraphicsEffect(m_tabHighlightEffect);
}
@@ -358,7 +351,7 @@ void TabBar::mouseReleaseEvent(QMouseEvent *event)
}
-void TabBar::tabRemoved(int index)
+void TabBar::tabRemoved(int /*index*/)
{
if (ReKonfig::hoveringTabOption() == 0)
{
@@ -368,9 +361,6 @@ void TabBar::tabRemoved(int index)
}
m_currentTabPreviewIndex = -1;
}
-
- QString propertyName = QString("hAnim").append(QString::number(index));
- setProperty(propertyName.toAscii(), QVariant()); //destroy property
}
@@ -404,36 +394,3 @@ void TabBar::setupHistoryActions()
am->addAction(a);
}
}
-
-
-QRect TabBar::tabTextRect(int index)
-{
- QStyleOptionTabV3 option;
- initStyleOption(&option, index);
- return style()->subElementRect(QStyle::SE_TabBarTabText, &option, this);
-}
-
-
-void TabBar::setTabHighlighted(int index, bool highlighted)
-{
- QString propertyName = QString("hAnim").append(QString::number(index));
- if (highlighted)
- {
- m_tabHighlightEffect->setProperty(propertyName.toAscii(), qreal(0.9));
- QPropertyAnimation *highlightAnimation = new QPropertyAnimation(m_tabHighlightEffect, propertyName.toAscii());
-
- //setup the animation
- highlightAnimation->setStartValue(0.9);
- highlightAnimation->setEndValue(0.0);
- highlightAnimation->setDuration(500);
- highlightAnimation->setLoopCount(2);
- highlightAnimation->start(QAbstractAnimation::DeleteWhenStopped);
-
- setTabTextColor(index, KColorScheme(QPalette::Active, KColorScheme::Window).foreground(KColorScheme::PositiveText).color());
- }
- else
- {
- m_tabHighlightEffect->setProperty(propertyName.toAscii(), QVariant()); //destroy the property
- setTabTextColor(index, QApplication::palette().text().color());
- }
-} \ No newline at end of file
diff --git a/src/tabbar.h b/src/tabbar.h
index a467e96e..b505f78b 100644
--- a/src/tabbar.h
+++ b/src/tabbar.h
@@ -39,7 +39,6 @@
// Forward Declarations
class KPassivePopup;
-class TabHighlightEffect;
/**
@@ -55,9 +54,6 @@ public:
explicit TabBar(QWidget *parent);
virtual ~TabBar() {}
- void setTabHighlighted(int index, bool highlighted);
- QRect tabTextRect(int index);
-
signals:
void cloneTab(int index);
void closeTab(int index);
@@ -78,7 +74,7 @@ protected:
virtual void leaveEvent(QEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
- virtual void tabRemoved(int index);
+ virtual void tabRemoved(int);
private slots:
void cloneTab();
@@ -108,7 +104,6 @@ private:
*/
int m_currentTabPreviewIndex;
bool m_isFirstTimeOnTab;
- TabHighlightEffect *m_tabHighlightEffect;
};
#endif
diff --git a/src/tabhighlighteffect.cpp b/src/tabhighlighteffect.cpp
deleted file mode 100644
index b03af0f2..00000000
--- a/src/tabhighlighteffect.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2010 Tröscher Johannes <fritz_van_tom@hotmail.com>
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-
-//Self Includes
-#include "tabhighlighteffect.h"
-#include "tabhighlighteffect.moc"
-
-//Qt Includes
-#include <QApplication>
-#include <QVariant>
-#include <tabbar.h>
-
-
-TabHighlightEffect::TabHighlightEffect(TabBar* tabBar)
- : QGraphicsEffect (tabBar)
- , m_tabBar(tabBar)
- , m_highlightColor(QApplication::palette().highlight().color().lighter())
-{
- Q_ASSERT(m_tabBar);
-}
-
-void TabHighlightEffect::draw(QPainter* painter)
-{
- painter->drawPixmap(QPoint(0,0), sourcePixmap());
-
- Q_FOREACH(const QByteArray &propertyName, dynamicPropertyNames())
- {
- int index = QString(propertyName).remove(0,5).toInt();
- qreal opacity = property(propertyName).toReal();
- QRect textRect = m_tabBar->tabTextRect(index);
-
- QString tabText = m_tabBar->fontMetrics().elidedText(m_tabBar->tabText(index), Qt::ElideRight,
- textRect.width(), Qt::TextShowMnemonic);
-
- painter->setOpacity(opacity);
- painter->setPen(m_highlightColor);
- painter->drawText(textRect, Qt::AlignCenter | Qt::TextShowMnemonic, tabText);
- }
-}
-
-bool TabHighlightEffect::event(QEvent* event)
-{
- if (event->type() == QEvent::DynamicPropertyChange)
- {
- QDynamicPropertyChangeEvent *pChangeEv = dynamic_cast<QDynamicPropertyChangeEvent*>(event);
-
- if(pChangeEv->propertyName().contains("hAnim"))
- {
- update();
- return true;
- }
- }
-
- return QGraphicsEffect::event(event);
-} \ No newline at end of file
diff --git a/src/tabhighlighteffect.h b/src/tabhighlighteffect.h
deleted file mode 100644
index 2459e778..00000000
--- a/src/tabhighlighteffect.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2010 Tröscher Johannes <fritz_van_tom@hotmail.com>
-*
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License as
-* published by the Free Software Foundation; either version 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*
-* ============================================================ */
-#ifndef TABHIGHLIGHTEFFECT_H
-#define TABHIGHLIGHTEFFECT_H
-
-// Qt Includes
-#include <QGraphicsEffect>
-#include <QPainter>
-#include <QEvent>
-
-// Forward Declarations
-class TabBar;
-
-class TabHighlightEffect : public QGraphicsEffect
-{
- Q_OBJECT
-
-public:
- explicit TabHighlightEffect (TabBar *tabBar = 0);
-
-protected:
- virtual void draw(QPainter *painter);
- virtual bool event(QEvent *event);
-
-private:
- TabBar * const m_tabBar;
- QColor m_highlightColor;
-};
-
-#endif // TABHIGHLIGHTEFFECT_H