1 Index: ui/kextendableitemdelegateanimation.cpp
2 ===================================================================
3 --- ui/kextendableitemdelegateanimation.cpp (revision 0)
4 +++ ui/kextendableitemdelegateanimation.cpp (revision 0)
6 +/* This file is part of the KDE project
8 + Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
10 + This program is free software; you can redistribute it and/or
11 + modify it under the terms of the GNU General Public
12 + License as published by the Free Software Foundation; either
13 + version 2 of the License, or (at your option) any later version.
16 +#include "kextendableitemdelegateanimation.h"
18 +#include "kextendableitemdelegate.h"
20 +#include <QStyleOptionViewItem>
23 +KExtendableItemDelegateAnimation::KExtendableItemDelegateAnimation(QObject *parent, KExtendableItemDelegate *itemDelegate,
24 + QWidget *widget, const QModelIndex &index)
26 + m_itemDelegate(itemDelegate),
31 + timeLine = new QTimeLine(500, this);
32 + timeLine->setFrameRange(0, 50);
36 +KExtendableItemDelegateAnimation::~KExtendableItemDelegateAnimation()
44 +void KExtendableItemDelegateAnimation::start()
47 + connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(nextFrame(int)));
48 + connect(timeLine, SIGNAL(finished()), this, SLOT(stop()));
52 +void KExtendableItemDelegateAnimation::stop()
58 +void KExtendableItemDelegateAnimation::nextFrame(int frame)
61 + QStyleOptionViewItem option;
62 + m_widget->setGeometry(0, 0, 800, frame * 4);
63 + QStyleOption styleOption;
64 + styleOption.initFrom(m_widget);
65 + option.rect = styleOption.rect;
66 + m_itemDelegate->updateExtenderGeometry(m_widget, option, m_index);
68 Index: ui/kextendableitemdelegateanimation.h
69 ===================================================================
70 --- ui/kextendableitemdelegateanimation.h (revision 0)
71 +++ ui/kextendableitemdelegateanimation.h (revision 0)
73 +/* This file is part of the KDE project
75 + Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
77 + This program is free software; you can redistribute it and/or
78 + modify it under the terms of the GNU General Public
79 + License as published by the Free Software Foundation; either
80 + version 2 of the License, or (at your option) any later version.
82 +#ifndef KEXTENDABLEITEMDELEGATEANIMATION_H
83 +#define KEXTENDABLEITEMDELEGATEANIMATION_H
87 +#include <QModelIndex>
90 +class KExtendableItemDelegate;
92 +class KExtendableItemDelegateAnimation : public QObject
96 + KExtendableItemDelegateAnimation(QObject *parent, KExtendableItemDelegate *itemDelegate, QWidget *widget, const QModelIndex &index);
97 + ~KExtendableItemDelegateAnimation();
102 + void nextFrame(int);
105 + QTimeLine *timeLine;
107 + const QModelIndex &m_index;
108 + KExtendableItemDelegate *m_itemDelegate;
113 Index: ui/transfersviewdelegate.cpp
114 ===================================================================
115 --- ui/transfersviewdelegate.cpp (revision 762997)
116 +++ ui/transfersviewdelegate.cpp (working copy)
118 #include "ui/transfersviewdelegate.h"
120 #include "transferdetails.h"
121 +#include "kextendableitemdelegateanimation.h"
122 #include "core/kget.h"
123 #include "core/transferhandler.h"
124 #include "core/transfergrouphandler.h"
127 m_editingIndexes.append(index);
128 extendItem(widget, index);
129 + new KExtendableItemDelegateAnimation(this, this, widget, index);
132 m_editingIndexes.removeAll(index);
133 Index: CMakeLists.txt
134 ===================================================================
135 --- CMakeLists.txt (revision 762997)
136 +++ CMakeLists.txt (working copy)
138 ui/viewscontainer.cpp
139 ui/newtransferdialog.cpp
140 ui/kextendableitemdelegate.cpp
141 + ui/kextendableitemdelegateanimation.cpp
142 ui/transferhistory.cpp