connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
}
+RotatingBackground::~RotatingBackground()
+{
+}
+
void RotatingBackground::loadWallpaper()
{
+ /*
QString loadfile = "/home/user/.backgrounds/background-1.png";
QFileInfo custombg("/root/.fapman/wallpaper.png");
bool custom = false;
loadfile = "/root/.fapman/wallpaper.png";
custom = true;
}
+ */
+ QString loadfile = "/root/.fapman/wallpaper.png";
iWallpaperLandscape.load(loadfile);
if( !iWallpaperLandscape.isNull() ) {
iWallpaperPortrait = iWallpaperLandscape.transformed(t);
}
+ /*
if( !custom && !iWallpaperLandscape.isNull() && !iWallpaperPortrait.isNull() )
{
QPainter l( &iWallpaperLandscape );
l.drawRect( 0, 0, iWallpaperLandscape.rect().width(), iWallpaperLandscape.rect().height() );
p.drawRect( 0, 0, iWallpaperPortrait.rect().width(), iWallpaperPortrait.rect().height() );
}
+ */
}
void RotatingBackground::paintEvent(QPaintEvent *)
}
}
-void RotatingBackground::resizeEvent(QResizeEvent *)
+void RotatingBackground::resizeEvent(QResizeEvent* event)
{
- this->resize( dynamic_cast<QWidget*>(parent())->size() );
+ QWidget::resizeEvent(event);
}
void RotatingBackground::orientationChanged()
{
- resizeEvent(0);
}