diff --git a/applications/Photoframe/pics/image_bg.png b/applications/Photoframe/pics/image_bg.png index b896c2a..49efd02 100755 --- a/applications/Photoframe/pics/image_bg.png +++ b/applications/Photoframe/pics/image_bg.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg.png b/applications/Photoframe/pics/image_bg.png index b896c2a..49efd02 100755 --- a/applications/Photoframe/pics/image_bg.png +++ b/applications/Photoframe/pics/image_bg.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.png b/applications/Photoframe/pics/image_bg0.png index 8ad79fc..87e8564 100755 --- a/applications/Photoframe/pics/image_bg0.png +++ b/applications/Photoframe/pics/image_bg0.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg.png b/applications/Photoframe/pics/image_bg.png index b896c2a..49efd02 100755 --- a/applications/Photoframe/pics/image_bg.png +++ b/applications/Photoframe/pics/image_bg.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.png b/applications/Photoframe/pics/image_bg0.png index 8ad79fc..87e8564 100755 --- a/applications/Photoframe/pics/image_bg0.png +++ b/applications/Photoframe/pics/image_bg0.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.xcf b/applications/Photoframe/pics/image_bg0.xcf new file mode 100644 index 0000000..ab1fac9 --- /dev/null +++ b/applications/Photoframe/pics/image_bg0.xcf Binary files differ diff --git a/applications/Photoframe/pics/image_bg.png b/applications/Photoframe/pics/image_bg.png index b896c2a..49efd02 100755 --- a/applications/Photoframe/pics/image_bg.png +++ b/applications/Photoframe/pics/image_bg.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.png b/applications/Photoframe/pics/image_bg0.png index 8ad79fc..87e8564 100755 --- a/applications/Photoframe/pics/image_bg0.png +++ b/applications/Photoframe/pics/image_bg0.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.xcf b/applications/Photoframe/pics/image_bg0.xcf new file mode 100644 index 0000000..ab1fac9 --- /dev/null +++ b/applications/Photoframe/pics/image_bg0.xcf Binary files differ diff --git a/applications/Photoframe/pics/image_bg2.png b/applications/Photoframe/pics/image_bg2.png new file mode 100644 index 0000000..b896c2a --- /dev/null +++ b/applications/Photoframe/pics/image_bg2.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg.png b/applications/Photoframe/pics/image_bg.png index b896c2a..49efd02 100755 --- a/applications/Photoframe/pics/image_bg.png +++ b/applications/Photoframe/pics/image_bg.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.png b/applications/Photoframe/pics/image_bg0.png index 8ad79fc..87e8564 100755 --- a/applications/Photoframe/pics/image_bg0.png +++ b/applications/Photoframe/pics/image_bg0.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.xcf b/applications/Photoframe/pics/image_bg0.xcf new file mode 100644 index 0000000..ab1fac9 --- /dev/null +++ b/applications/Photoframe/pics/image_bg0.xcf Binary files differ diff --git a/applications/Photoframe/pics/image_bg2.png b/applications/Photoframe/pics/image_bg2.png new file mode 100644 index 0000000..b896c2a --- /dev/null +++ b/applications/Photoframe/pics/image_bg2.png Binary files differ diff --git a/applications/Photoframe/src/iconview.cpp b/applications/Photoframe/src/iconview.cpp index 1f61c76..5766afc 100755 --- a/applications/Photoframe/src/iconview.cpp +++ b/applications/Photoframe/src/iconview.cpp @@ -362,6 +362,7 @@ fadeInId = 0; fadeOutId = 0; tmp = 0; + setFocus(); } ~FadeInOutPreview() { } void fadeIn() { @@ -374,13 +375,16 @@ int fadeInId; int fadeOutId; int tmp; - void timerEvent(QTimerEvent *te) { + void keyPressEvent(QKeyEvent* ke) { + tmp = 200; + } + void timerEvent(QTimerEvent* te) { if (te->timerId() == fadeInId) { tick++; if (tick > 30) { tick = 30; tmp++; - if (tmp > 40) { + if (tmp > 200) { killTimer(fadeInId); fadeInId = 0; if (autoOut) @@ -421,9 +425,9 @@ fadeRatio = (60.0 - tick) / 20.0; } - size.scale(ratio*(800-90)+90, ratio*(480-70)+70, Qt::KeepAspectRatio); - - p2 = pix.scaled(size); + size.scale(ratio *(800-90)+90, ratio*(480-70)+70, Qt::KeepAspectRatio); + + p2 = pix.scaled(size, Qt::IgnoreAspectRatio, (tick == 30) ? Qt::SmoothTransformation : Qt::FastTransformation); int _x = -15+(1.0-ratio)*x+((ratio*(800-90)+90)/2)-size.width()/2; int _y = -15+(1.0-ratio)*y+((ratio*(480-70)+70)/2)-size.height()/2; diff --git a/applications/Photoframe/pics/image_bg.png b/applications/Photoframe/pics/image_bg.png index b896c2a..49efd02 100755 --- a/applications/Photoframe/pics/image_bg.png +++ b/applications/Photoframe/pics/image_bg.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.png b/applications/Photoframe/pics/image_bg0.png index 8ad79fc..87e8564 100755 --- a/applications/Photoframe/pics/image_bg0.png +++ b/applications/Photoframe/pics/image_bg0.png Binary files differ diff --git a/applications/Photoframe/pics/image_bg0.xcf b/applications/Photoframe/pics/image_bg0.xcf new file mode 100644 index 0000000..ab1fac9 --- /dev/null +++ b/applications/Photoframe/pics/image_bg0.xcf Binary files differ diff --git a/applications/Photoframe/pics/image_bg2.png b/applications/Photoframe/pics/image_bg2.png new file mode 100644 index 0000000..b896c2a --- /dev/null +++ b/applications/Photoframe/pics/image_bg2.png Binary files differ diff --git a/applications/Photoframe/src/iconview.cpp b/applications/Photoframe/src/iconview.cpp index 1f61c76..5766afc 100755 --- a/applications/Photoframe/src/iconview.cpp +++ b/applications/Photoframe/src/iconview.cpp @@ -362,6 +362,7 @@ fadeInId = 0; fadeOutId = 0; tmp = 0; + setFocus(); } ~FadeInOutPreview() { } void fadeIn() { @@ -374,13 +375,16 @@ int fadeInId; int fadeOutId; int tmp; - void timerEvent(QTimerEvent *te) { + void keyPressEvent(QKeyEvent* ke) { + tmp = 200; + } + void timerEvent(QTimerEvent* te) { if (te->timerId() == fadeInId) { tick++; if (tick > 30) { tick = 30; tmp++; - if (tmp > 40) { + if (tmp > 200) { killTimer(fadeInId); fadeInId = 0; if (autoOut) @@ -421,9 +425,9 @@ fadeRatio = (60.0 - tick) / 20.0; } - size.scale(ratio*(800-90)+90, ratio*(480-70)+70, Qt::KeepAspectRatio); - - p2 = pix.scaled(size); + size.scale(ratio *(800-90)+90, ratio*(480-70)+70, Qt::KeepAspectRatio); + + p2 = pix.scaled(size, Qt::IgnoreAspectRatio, (tick == 30) ? Qt::SmoothTransformation : Qt::FastTransformation); int _x = -15+(1.0-ratio)*x+((ratio*(800-90)+90)/2)-size.width()/2; int _y = -15+(1.0-ratio)*y+((ratio*(480-70)+70)/2)-size.height()/2; diff --git a/applications/Photoframe/src/mainmenu.cpp b/applications/Photoframe/src/mainmenu.cpp index c09a2b4..121c217 100755 --- a/applications/Photoframe/src/mainmenu.cpp +++ b/applications/Photoframe/src/mainmenu.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "mainmenu.h" #include "image.h" @@ -44,6 +45,24 @@ const int menuSize = sizeof(menuItems) / sizeof(const char *); +QT_BEGIN_NAMESPACE +extern Q_WIDGETS_EXPORT void qt_blurImage(QPainter* p, QImage& blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0); +QT_END_NAMESPACE + + +QPixmap blurPixmap(const QPixmap& inPixmap) +{ + QImage srcImg = inPixmap.toImage(); //source image + QPixmap pxDst(srcImg.size());//blurred destination + pxDst.fill(Qt::transparent); + { + QPainter painter(&pxDst); + qt_blurImage(&painter, srcImg, 10, true, false);//blur radius: 2px + } + return pxDst; +} + + class AnimatedIcon : public QWidget { public: @@ -56,6 +75,8 @@ void setPixmaps(int _a, int _b) { a = Image::icon(iconMap[_a], 256); b = Image::icon(iconMap[_b], 256); + ablur = blurPixmap(a); + bblur = blurPixmap(b); } void setFrame(int f) { frame = f; @@ -79,7 +100,7 @@ trans.scale(scale, -scale); p.setWorldTransform(trans); p.setOpacity(0.3 * ((20 - frame) / 20.0)); - p.drawPixmap(380 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), a); + p.drawPixmap(380 * (1.0 - scale) + 160 - frame * 10, -2.0 * a.height(), ablur); p.resetTransform(); // Draw icon 'b' @@ -96,10 +117,11 @@ trans.scale(scale, -scale); p.setWorldTransform(trans); p.setOpacity(0.3 * (frame / 20.0)); - p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), b); + p.drawPixmap(720 * (1.0 - scale) + 360 - frame * 10, -2.0 * b.height(), bblur); p.resetTransform(); } QPixmap a, b; + QPixmap ablur, bblur; int frame; };