[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/applets/kickoff/ui
From: Mohammad Mehdi Salem Naraghi <momesana () googlemail ! com>
Date: 2009-03-27 16:54:43
Message-ID: 1238172883.128078.18560.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 945535 by momesana:
Removed the intro animation
M +3 -73 tabbar.cpp
M +0 -6 tabbar.h
--- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/ui/tabbar.cpp #945534:945535
@@ -45,14 +45,12 @@
m_hoveredTabIndex(-1),
m_switchOnHover(true),
m_animateSwitch(true),
- m_animProgress(1.0),
- m_introAnimProgress(0.0)
+ m_animProgress(1.0)
{
m_lastIndex[0] = -1;
connect(this, SIGNAL(currentChanged(int)), this, SLOT(startAnimation()));
m_tabSwitchTimer.setSingleShot(true);
- m_startAnimationTimer.setSingleShot(true);
connect(&m_tabSwitchTimer, SIGNAL(timeout()), this, SLOT(switchToHoveredTab()));
setMouseTracking(true);
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -198,7 +196,7 @@
QPainterPath TabBar::tabPath(const QRectF &_r)
{
- const qreal radius = 6 * m_introAnimProgress;
+ const qreal radius = 6;
Shape s = shape();
QPainterPath path;
QRectF r = _r;
@@ -206,7 +204,6 @@
switch (s) {
case RoundedSouth:
case TriangularSouth:
- r.setHeight(r.height() * m_introAnimProgress);
r.adjust(0, 0, 0, -3);
path.moveTo(r.topLeft());
// Top left corner
@@ -223,8 +220,7 @@
break;
case RoundedNorth:
case TriangularNorth:
- r.setHeight(r.height() * m_introAnimProgress);
- r.moveBottom(_r.bottom());
+
r.adjust(0, 3, 0, 1);
path.moveTo(r.bottomLeft());
// Bottom left corner
@@ -241,8 +237,6 @@
break;
case RoundedWest:
case TriangularWest:
- r.setWidth(r.width() * m_introAnimProgress);
- r.moveRight(_r.right());
r.adjust(3, 0, 1, 0);
path.moveTo(r.topRight());
// Top right corner
@@ -260,7 +254,6 @@
break;
case RoundedEast:
case TriangularEast:
- r.setWidth(r.width() * m_introAnimProgress);
r.adjust(0, 0, -3, 0);
path.moveTo(r.topLeft());
// Top left corner
@@ -322,47 +315,6 @@
iconRect.setBottom(iconRect.bottom() - textHeight);
iconRect.adjust(0, (isVertical() ? 1 : 0) * TAB_CONTENTS_MARGIN + 3, 0, 0);
- if (!qFuzzyCompare(m_introAnimProgress, 1.0)) {
- QRectF centerRect = iconRect;
- centerRect.moveCenter(this->rect().center());
-
- qreal distance = QLineF(iconRect.center(), centerRect.center()).length() \
* m_introAnimProgress;
-
- Shape s = shape();
- switch (s) {
- case RoundedNorth:
- case RoundedSouth:
- case TriangularNorth:
- case TriangularSouth:
- centerRect.moveTop(iconRect.top());
- if (iconRect.left() < centerRect.left()) {
- iconRect.moveCenter(centerRect.center() - QPoint(distance, \
0));
- } else {
- iconRect.moveCenter(centerRect.center() + QPoint(distance, \
0));
- }
- break;
- case RoundedEast:
- case RoundedWest:
- case TriangularEast:
- case TriangularWest:
- centerRect.moveLeft(iconRect.left());
- if (iconRect.top() < centerRect.top()) {
- iconRect.moveCenter(centerRect.center() - QPoint(0, \
distance));
- } else {
- iconRect.moveCenter(centerRect.center() + QPoint(0, \
distance));
- }
- break;
- }
-
- // icon zoom effect
- QPointF iconCenter = iconRect.center();
- const qreal MIN_ZOOM = 0.8;
- iconRect.setWidth(iconRect.width() * MIN_ZOOM + iconRect.width() * (1.0 \
- MIN_ZOOM) * m_introAnimProgress);
- iconRect.setHeight(iconRect.height() * MIN_ZOOM + iconRect.height() * \
(1.0 - MIN_ZOOM) * m_introAnimProgress);
- iconRect.moveCenter(iconCenter);
-
- painter.setOpacity(m_introAnimProgress);
- }
tabIcon(i).paint(&painter, iconRect.toRect());
// draw tab text
@@ -422,21 +374,6 @@
Plasma::Animator::self()->customAnimation(10, 150, \
Plasma::Animator::EaseInOutCurve, this, "onValueChanged"); }
-void TabBar::startIntroAnimation()
-{
- Plasma::Animator::self()->customAnimation(10, 200, \
Plasma::Animator::EaseInCurve, this, "onIntroValueChanged");
-}
-
-void TabBar::showEvent(QShowEvent* event)
-{
- QTimer::singleShot(250, this, SLOT(startIntroAnimation()));
-}
-
-void TabBar::hideEvent(QHideEvent* event)
-{
- m_introAnimProgress = 0.0;
-}
-
void TabBar::onValueChanged(qreal value)
{
if ((m_animProgress = value) == 1.0) {
@@ -453,13 +390,6 @@
update();
}
-void TabBar::onIntroValueChanged(qreal value)
-{
- m_introAnimProgress = value;
-
- update();
-}
-
void TabBar::animationFinished()
{
m_currentAnimRect = QRect();
--- trunk/KDE/kdebase/workspace/plasma/applets/kickoff/ui/tabbar.h #945534:945535
@@ -60,8 +60,6 @@
virtual void leaveEvent(QEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void resizeEvent(QResizeEvent* event);
- virtual void showEvent(QShowEvent* event);
- virtual void hideEvent(QHideEvent* event);
bool isHorizontal() const;
bool isVertical() const;
@@ -71,8 +69,6 @@
void animationFinished();
void startAnimation();
void onValueChanged(qreal val);
- void onIntroValueChanged(qreal val);
- void startIntroAnimation();
private:
QPainterPath tabPath(const QRectF &r);
@@ -80,13 +76,11 @@
static const int TAB_CONTENTS_MARGIN = 6;
int m_hoveredTabIndex;
QTimer m_tabSwitchTimer;
- QTimer m_startAnimationTimer;
bool m_switchOnHover;
bool m_animateSwitch;
QRectF m_currentAnimRect;
int m_lastIndex[2];
qreal m_animProgress;
- qreal m_introAnimProgress;
Plasma::FrameSvg *background;
QSize tabSize(int index) const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic