summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/thememoodin.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/thememoodin.cpp b/src/thememoodin.cpp
index d1711fa..2ad557c 100644
--- a/src/thememoodin.cpp
+++ b/src/thememoodin.cpp
@@ -161,6 +161,7 @@ void ThemeMoodin::initBackground(TQPainter* p)
return;
TQString bgImage;
+ bool scaleBgImage;
if (mUsersBackground)
{
@@ -170,18 +171,29 @@ void ThemeMoodin::initBackground(TQPainter* p)
kdesktoprc.setGroup(TQString("Desktop%1").arg(num));
bgImage = kdesktoprc.readPathEntry("Wallpaper", TQString());
+ if (kdesktoprc.readPathEntry("WallpaperMode", TQString()) == "Scaled") {
+ scaleBgImage = true;
+ }
+ else {
+ scaleBgImage = false;
+ }
}
else
{
if (!mBackgroundImage.isEmpty())
bgImage = mTheme->locateThemeData(mBackgroundImage);
+ scaleBgImage = false;
}
- if (bgImage.isEmpty())
+ if (bgImage.isEmpty()) {
bgImage = mTheme->locateThemeData(TQString("Background-%1x%2.jpg").arg(width()).arg(height()));
+ scaleBgImage = false;
+ }
- if (bgImage.isEmpty())
+ if (bgImage.isEmpty()) {
bgImage = mTheme->locateThemeData("Background.jpg");
+ scaleBgImage = true;
+ }
if (bgImage.isEmpty())
{
@@ -190,7 +202,12 @@ void ThemeMoodin::initBackground(TQPainter* p)
}
TQImage* bg = mCache->cacheFile(bgImage);
- p->drawImage(0, 0, *bg);
+ if (scaleBgImage) {
+ p->drawImage(0, 0, (*bg).scale(width(), height()));
+ }
+ else {
+ p->drawImage(0, 0, *bg);
+ }
delete bg;
if (mKubuntuStyle) {