browsercore/appfw/Common/FilmstripFlow.cpp
changeset 5 0f2326c2a325
parent 0 1450b09d0cfd
child 6 1c3b8676e58c
equal deleted inserted replaced
1:b0dd75e285d2 5:0f2326c2a325
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
     4 *
     9 * Initial Contributors:
     5 * This program is free software: you can redistribute it and/or modify
    10 * Nokia Corporation - initial contribution.
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
    11 *
    13 *
    12 * Contributors:
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
    13 *
    17 *
    14 * Description: 
    18 * Description:
    15 *
    19 *
    16 */
    20 *   FilmstripFlow - animated image show widget
    17 
    21 */
    18 #include <QDebug>
    22 #include <QDebug>
    19 #include <QImage>
    23 #include <QImage>
    20 #include <QPainter>
    24 #include <QPainter>
    21 #include <QResizeEvent>
    25 #include <QResizeEvent>
    22 #include <QTimeLine>
    26 #include <QTimeLine>
   220 void Filmstrip::createEmptyImage()
   224 void Filmstrip::createEmptyImage()
   221 {
   225 {
   222     QRectF target = m_movie->movieClip(0);
   226     QRectF target = m_movie->movieClip(0);
   223     int w = target.width();
   227     int w = target.width();
   224     int h = target.height();
   228     int h = target.height();
   225     m_name =  qtTrId("txt_browser_windows_new_window");
   229     if (m_name.isEmpty())
       
   230         m_name =  qtTrId("txt_browser_windows_new_window");
   226     m_img = QImage(w, h, QImage::Format_RGB32);
   231     m_img = QImage(w, h, QImage::Format_RGB32);
   227 
   232 
   228     QPainter painter(&m_img);
   233     QPainter painter(&m_img);
   229     painter.fillRect(0, 0, w, h, Qt::white);
   234     painter.fillRect(0, 0, w, h, Qt::white);
   230     /*QPoint p1(w*4/10, 0);
   235     /*QPoint p1(w*4/10, 0);
  1248 /*!
  1253 /*!
  1249   Set center index
  1254   Set center index
  1250 */
  1255 */
  1251 void GraphicsFilmstripFlow::setCenterIndex(int i)
  1256 void GraphicsFilmstripFlow::setCenterIndex(int i)
  1252 {
  1257 {
  1253     qDebug() << "!!!Set Center Index:" << i;
  1258     //qDebug() << "!!!Set Center Index:" << i;
  1254     Q_ASSERT(d);
  1259     Q_ASSERT(d);
  1255     if (!d->m_films.size())
  1260     if (!d->m_films.size())
  1256         return;
  1261         return;
  1257     Q_ASSERT(i >= 0 && i < d->m_films.size());
  1262     Q_ASSERT(i >= 0 && i < d->m_films.size());
  1258     d->m_centerIndex = i;
  1263     d->m_centerIndex = i;