From: Jean-Baptiste Mardelle Date: Fri, 29 Feb 2008 17:00:16 +0000 (+0000) Subject: small ui improvements X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=197a48fb2a551e763f888fe1f5412dd89b7ac2ba;p=kdenlive small ui improvements svn path=/branches/KDE4/; revision=1964 --- diff --git a/src/clipitem.cpp b/src/clipitem.cpp index d7b929d7..398727e1 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -34,7 +34,7 @@ #include "kdenlivesettings.h" ClipItem::ClipItem(DocClipBase *clip, int track, int startpos, const QRectF & rect, int duration) -: QGraphicsRectItem(rect), m_clip(clip), m_resizeMode(NONE), m_grabPoint(0), m_maxTrack(0), m_track(track), m_startPos(startpos), m_hasThumbs(false), startThumbTimer(NULL), endThumbTimer(NULL), m_startFade(0), m_endFade(0), m_effectsCounter(0),audioThumbWasDrawn(false),audioThumbReady(false) +: QGraphicsRectItem(rect), m_clip(clip), m_resizeMode(NONE), m_grabPoint(0), m_maxTrack(0), m_track(track), m_startPos(startpos), m_hasThumbs(false), startThumbTimer(NULL), endThumbTimer(NULL), m_startFade(0), m_endFade(0), m_effectsCounter(0),audioThumbWasDrawn(false),audioThumbReady(false), m_opacity(1.0), m_timeLine(0) { //setToolTip(name); kDebug()<<"******* CREATING NEW TML CLIP, DUR: "<start(); +} + +void ClipItem::animate(qreal value) +{ + m_opacity = value; + update(); +} + // virtual void ClipItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + painter->setOpacity(m_opacity); QRectF br = rect(); - QRect rectInView;//this is the rect that is visiable by the user + QRect rectInView;//this is the rect that is visible by the user if (scene()->views().size()>0){ rectInView=scene()->views()[0]->viewport()->rect(); rectInView.moveTo(scene()->views()[0]->horizontalScrollBar()->value(),scene()->views()[0]->verticalScrollBar()->value()); @@ -309,11 +326,12 @@ int ClipItem::endPos() painter->setFont(font); } + if (isSelected()) painter->fillRect(br.intersected(rectInView), QBrush(QColor(200,20,0,80))); pen.setColor(Qt::red); //pen.setStyle(Qt::DashDotDotLine); //Qt::DotLine); if (isSelected()) painter->setPen(pen); - painter->setClipRect(option->exposedRect); - painter->drawPath(roundRectPathUpper.united(roundRectPathLower).intersected(clippath)); + painter->setClipRect(option->exposedRect); + painter->drawPath(roundRectPathUpper.united(roundRectPathLower).intersected(clippath)); QRectF txtBounding = painter->boundingRect(br, Qt::AlignCenter, " " + m_clipName + " "); painter->fillRect(txtBounding, QBrush(QColor(255,255,255,150))); @@ -626,6 +644,7 @@ QMap ClipItem::addEffect(QDomElement effect) if (!e.isNull()) effectParams[e.attribute("name")] = e.attribute("value"); } + flashClip(); update(boundingRect()); return effectParams; } @@ -666,6 +685,7 @@ void ClipItem::deleteEffect(QString index) break; } } + flashClip(); update(boundingRect()); } diff --git a/src/clipitem.h b/src/clipitem.h index a4976072..6d89f16b 100644 --- a/src/clipitem.h +++ b/src/clipitem.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "definitions.h" #include "gentime.h" @@ -79,6 +80,7 @@ class ClipItem : public QObject, public QGraphicsRectItem QDomElement effectAt(int ix); /** Replace effect at pos ix with given value */ void setEffectAt(int ix, QDomElement effect); + void flashClip(); protected: virtual void mouseMoveEvent ( QGraphicsSceneMouseEvent * event ); @@ -109,12 +111,15 @@ class ClipItem : public QObject, public QGraphicsRectItem uint m_endFade; /** counter used to provide a unique id to each effect */ int m_effectsCounter; + double m_opacity; + QTimeLine *m_timeLine; EffectsList m_effectList; QMap audioThumbCachePic; bool audioThumbWasDrawn,audioThumbReady; double framePixelWidth; QMap channelPaths; + private slots: void slotThumbReady(int frame, QPixmap pix); void slotFetchThumbs(); @@ -122,6 +127,8 @@ class ClipItem : public QObject, public QGraphicsRectItem void slotGetEndThumb(); void slotGotAudioData(); void slotPrepareAudioThumb(double,QPainterPath,int,int); + void animate(qreal value); + signals: void getThumb(int, int); void prepareAudioThumb(double,QPainterPath,int,int); diff --git a/src/projectlistview.cpp b/src/projectlistview.cpp index 1eae496a..e03bfea5 100644 --- a/src/projectlistview.cpp +++ b/src/projectlistview.cpp @@ -31,6 +31,7 @@ ProjectListView::ProjectListView(QWidget *parent) setSelectionMode(QAbstractItemView::ExtendedSelection); setDragDropMode(QAbstractItemView::DragDrop); setDropIndicatorShown(true); + setAlternatingRowColors(true); setDragEnabled(true); setAcceptDrops(true); } diff --git a/src/widgets/effectlist_ui.ui b/src/widgets/effectlist_ui.ui index 7789cb21..3b423f9e 100644 --- a/src/widgets/effectlist_ui.ui +++ b/src/widgets/effectlist_ui.ui @@ -55,7 +55,14 @@ Qt::Vertical - + + + true + + + true + + QFrame::StyledPanel