View Single Post
Blaizzen's Avatar
Posts: 397 | Thanked: 802 times | Joined on Jan 2010 @ Sydney
#693
Not sure if its been mentioned here before (I tried a google search etc), but I was wondering if its possible to have animated backgrounds. I tinkered a bit with the code and got this:
(sorry for the bad quality )
http://www.youtube.com/watch?v=OyvoB2ueDy8

Its very buggy though, and I think it died when I rotated the screen, however its more of a trial. Could this be implemented in the future? Or would this cause significant battery drain? I will try modify the code further to make it less buggy, but so far i've been guessing so not sure how it'll go

Btw awesome app

The code modifications I made are
Originally Posted by lockscreen.cpp
#ifdef Q_WS_MAEMO_5

#include <QtGui/QMovie>

#include<QLabel>
#include<QGraphicsProxyWidget>

#include <QtGui/QWidget>
#include <QtGui/QX11Info>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <mce/dbus-names.h>
#include <mce/mode-names.h>

#endif

bool LockScreen:ebug;
bool LockScreen::ScreenshotMode;
QSettings* LockScreen::Settings;

LockScreen::LockScreen(QWidget *parent) :
QObject(parent)
{
.......

void LockScreen::setBackground()
{
bool isPortrait = LsWidget::isPortrait();

QString bkg;
if (isPortrait)
bkg = LockScreen::Settings->value("Main/BackGroundImageP", "/opt/usr/share/themes/alpha/backgrounds/lockslider.png").toString();
else
bkg = LockScreen::Settings->value("Main/BackGroundImageL", "/opt/usr/share/themes/alpha/backgrounds/lockslider.png").toString();

if (m_BkgPath != bkg){
if (!bkg.isEmpty())
{
QMovie *movie = new QMovie("/home/user/MyDocs/rotate.gif");
QLabel *processLabel = new QLabel();
processLabel->setGeometry(0,0,800,480);
processLabel->setMovie(movie);
movie->start();

QGraphicsProxyWidget *proxy = m_Scene.addWidget(processLabel);
m_Scene.setBackgroundBrush(QPixmap(bkg));
}
else
m_Scene.setBackgroundBrush(QBrush(QColor(0,0,0,0)) );

m_BkgPath = bkg;
}
}
edit: added image.
Attached Files
File Type: zip rotate.zip (196.3 KB, 84 views)

Last edited by Blaizzen; 2011-09-30 at 15:29.