equal
deleted
inserted
replaced
23 #include <QDebug> |
23 #include <QDebug> |
24 |
24 |
25 //User Includes |
25 //User Includes |
26 #include <glxmodelparm.h> |
26 #include <glxmodelparm.h> |
27 #include <glxcoverflow.h> |
27 #include <glxcoverflow.h> |
28 |
28 #include "glxviewids.h" |
29 |
29 |
30 const int KMoveX = 60; //coverflow auto move speed |
30 const int KMoveX = 60; //coverflow auto move speed |
31 |
31 |
32 GlxCoverFlow::GlxCoverFlow(QGraphicsItem *parent ) : HbScrollArea(parent), mSelItemIndex (0), |
32 GlxCoverFlow::GlxCoverFlow(QGraphicsItem *parent ) : HbScrollArea(parent), mSelItemIndex (0), |
33 mRows(0), mSelIndex (0), mStripLen (0), mCurrentPos(0), |
33 mRows(0), mSelIndex (0), mStripLen (0), mCurrentPos(0), |
136 } |
136 } |
137 |
137 |
138 void GlxCoverFlow::panGesture ( const QPointF & delta ) |
138 void GlxCoverFlow::panGesture ( const QPointF & delta ) |
139 { |
139 { |
140 qDebug("GlxCoverFlow::panGesture deltaX= %d", (int)delta.x()); |
140 qDebug("GlxCoverFlow::panGesture deltaX= %d", (int)delta.x()); |
141 |
141 if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) |
|
142 { |
|
143 return; |
|
144 } |
142 move((int) delta.x()); |
145 move((int) delta.x()); |
143 if( delta.x() > 0 ) { |
146 if( delta.x() > 0 ) { |
144 mMoveDir = RIGHT_MOVE; |
147 mMoveDir = RIGHT_MOVE; |
145 } |
148 } |
146 else if ( delta.x() < 0) { |
149 else if ( delta.x() < 0) { |
155 |
158 |
156 void GlxCoverFlow::leftGesture(int value) |
159 void GlxCoverFlow::leftGesture(int value) |
157 { |
160 { |
158 Q_UNUSED(value); |
161 Q_UNUSED(value); |
159 qDebug("GlxCoverFlow::leftGesture CurrentPos= %d value %d", mCurrentPos, value); |
162 qDebug("GlxCoverFlow::leftGesture CurrentPos= %d value %d", mCurrentPos, value); |
|
163 if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) |
|
164 { |
|
165 return; |
|
166 } |
160 mMoveDir = NO_MOVE; |
167 mMoveDir = NO_MOVE; |
161 mBounceBackDeltaX = mItemSize.width() >> 2; |
168 mBounceBackDeltaX = mItemSize.width() >> 2; |
162 emit autoLeftMoveSignal(); |
169 emit autoLeftMoveSignal(); |
163 if ( mUiOn == TRUE ) { |
170 if ( mUiOn == TRUE ) { |
164 mUiOn = FALSE; |
171 mUiOn = FALSE; |
168 |
175 |
169 void GlxCoverFlow::rightGesture(int value) |
176 void GlxCoverFlow::rightGesture(int value) |
170 { |
177 { |
171 Q_UNUSED(value); |
178 Q_UNUSED(value); |
172 qDebug("GlxCoverFlow::rightGesture CurrentPos= %d value %d ", mCurrentPos, value); |
179 qDebug("GlxCoverFlow::rightGesture CurrentPos= %d value %d ", mCurrentPos, value); |
|
180 if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) |
|
181 { |
|
182 return; |
|
183 } |
173 mMoveDir = NO_MOVE; |
184 mMoveDir = NO_MOVE; |
174 mBounceBackDeltaX = mItemSize.width() >> 2; |
185 mBounceBackDeltaX = mItemSize.width() >> 2; |
175 emit autoRightMoveSignal(); |
186 emit autoRightMoveSignal(); |
176 if ( mUiOn == TRUE ) { |
187 if ( mUiOn == TRUE ) { |
177 mUiOn = FALSE; |
188 mUiOn = FALSE; |
565 delete mIconItem[i] ; |
576 delete mIconItem[i] ; |
566 mIconItem[i] = NULL; |
577 mIconItem[i] = NULL; |
567 } |
578 } |
568 } |
579 } |
569 } |
580 } |
|
581 |
|
582 int GlxCoverFlow::getSubState() |
|
583 { |
|
584 int substate = NO_FULLSCREEN_S; |
|
585 QVariant variant = mModel->data( mModel->index(0,0), GlxSubStateRole ); |
|
586 if ( variant.isValid() && variant.canConvert<int> () ) { |
|
587 substate = variant.value<int>(); |
|
588 } |
|
589 return substate; |
|
590 } |