112
112
if ( list == m_currentlist )
115
debug() << "adding " << list.count() << "new pics";
115
// debug() << "adding " << list.count() << "new pics";
116
116
// If a new one arrived, we change.
117
117
foreach( PhotosInfo *item, list )
119
119
if ( !m_currentlist.contains( item ) )
121
if ( !item->photo->isNull() )
123
case PHOTOS_MODE_INTERACTIVE :
126
if ( !m_id ) // careful we're animating
125
case PHOTOS_MODE_INTERACTIVE :
128
Plasma::Animator::self()->stopCustomAnimation( m_id );
131
DragPixmapItem *dragpix = new DragPixmapItem( this );
132
dragpix->setPixmap( The::svgHandler()->addBordersToPixmap(
133
item->photo->scaledToHeight( (int) size().height() - 4 * m_margin, Qt::SmoothTransformation ), 5, "", true ) );
134
dragpix->setPos( m_actualpos, 0 );
135
dragpix->SetClickableUrl( item->urlpage );
138
m_pixmaplist << dragpix;
140
int delta = dragpix->boundingRect().width() + m_margin;
141
m_scrollmax += delta;
142
m_actualpos += delta;
146
case PHOTOS_MODE_AUTOMATIC :
149
DragPixmapItem *dragpix = new DragPixmapItem( this );
150
dragpix->setPixmap( The::svgHandler()->addBordersToPixmap(
128
if ( !m_id ) // careful we're animating
130
Plasma::Animator::self()->stopCustomAnimation( m_id );
134
DragPixmapItem *dragpix = new DragPixmapItem( this );
135
dragpix->setPixmap( The::svgHandler()->addBordersToPixmap(
151
136
item->photo->scaledToHeight( (int) size().height() - 4 * m_margin, Qt::SmoothTransformation ), 5, "", true ) );
152
dragpix->SetClickableUrl( item->urlpage );
154
if ( m_id == 0 ) // only pos and show if no animation, otherwise it will be set at the end automatically
156
if ( ! m_pixmaplist.empty() )
158
dragpix->setPos( m_pixmaplist.last()->boundingRect().width() + m_pixmaplist.last()->pos().x() + m_margin , 0 ) ;
164
dragpix->setPos( m_actualpos, 0 ) ;
169
m_pixmaplist << dragpix;
171
// set a timer after and launch
172
QTimer::singleShot( m_interval, this, SLOT( automaticAnimBegin() ) );
176
case PHOTOS_MODE_FADING :
179
DragPixmapItem *dragpix = new DragPixmapItem( this );
180
dragpix->setPixmap( The::svgHandler()->addBordersToPixmap(
181
item->photo->scaledToHeight( (int) size().height() - 4 * m_margin, Qt::SmoothTransformation ), 5, "", true ) );
182
dragpix->setPos( ( size().width() - dragpix->boundingRect().width() ) / 2, 0 );
183
dragpix->SetClickableUrl( item->urlpage );
185
m_pixmaplist << dragpix;
186
if ( m_pixmaplist.size() == 1 )
137
dragpix->setPos( m_actualpos, 0 );
138
dragpix->SetClickableUrl( item->urlpage );
189
m_timer->start( m_interval );
141
m_pixmaplist << dragpix;
143
int delta = dragpix->boundingRect().width() + m_margin;
144
m_scrollmax += delta;
145
m_actualpos += delta;
149
case PHOTOS_MODE_AUTOMATIC :
152
DragPixmapItem *dragpix = new DragPixmapItem( this );
153
dragpix->setPixmap( The::svgHandler()->addBordersToPixmap(
154
item->photo->scaledToHeight( (int) size().height() - 4 * m_margin, Qt::SmoothTransformation ), 5, "", true ) );
155
dragpix->SetClickableUrl( item->urlpage );
157
if ( m_id == 0 ) // only pos and show if no animation, otherwise it will be set at the end automatically
159
if ( ! m_pixmaplist.empty() )
161
dragpix->setPos( m_pixmaplist.last()->boundingRect().width() + m_pixmaplist.last()->pos().x() + m_margin , 0 ) ;
167
dragpix->setPos( m_actualpos, 0 ) ;
172
m_pixmaplist << dragpix;
174
// set a timer after and launch
175
QTimer::singleShot( m_interval, this, SLOT( automaticAnimBegin() ) );
179
case PHOTOS_MODE_FADING :
182
DragPixmapItem *dragpix = new DragPixmapItem( this );
183
dragpix->setPixmap( The::svgHandler()->addBordersToPixmap(
184
item->photo->scaledToHeight( (int) size().height() - 4 * m_margin, Qt::SmoothTransformation ), 5, "", true ) );
185
dragpix->setPos( ( size().width() - dragpix->boundingRect().width() ) / 2, 0 );
186
dragpix->SetClickableUrl( item->urlpage );
188
m_pixmaplist << dragpix;
189
if ( m_pixmaplist.size() == 1 )
192
m_timer->start( m_interval );
197
201
m_currentlist = list;
198
debug() << "total count: " << m_pixmaplist.count();
202
// debug() << "total count: " << m_pixmaplist.count();
201
205
void PhotosScrollWidget::hoverEnterEvent(QGraphicsSceneHoverEvent*)