Use Scale & Crop as default style for wallpaper.

Add more options to "Set as Background" menu in Konqueror.
This resolves issue #280 and issue #281.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit 14bc816be9)
r14.0.x
Michele Calgaro 2 years ago
parent 90ea879f2b
commit ab384ed0d5
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -24,12 +24,10 @@
#define _defMinOptimizationDepth 1
// Per desktop defaults
// Before you change this get in touch with me (kb9vqf@pearsoncomputing.net)
// Thanks!!
#define _defColorA TQColor("#003082")
#define _defColorB TQColor("#C0C0C0")
#define _defBackgroundMode KBackgroundSettings::Flat
#define _defWallpaperMode KBackgroundSettings::Scaled
#define _defWallpaperMode KBackgroundSettings::ScaleAndCrop
#define _defMultiMode KBackgroundSettings::NoMulti
#define _defBlendMode KBackgroundSettings::NoBlending
#define _defBlendBalance 100

@ -1,5 +1,4 @@
/*
This file is part of the KDE libraries
Copyright (c) 2005 David Saxton <david@bluehaze.org>
@ -245,10 +244,36 @@ BGDialog::BGDialog(TQWidget* parent, TDEConfig* _config, bool _multidesktop)
m_slideShowRandom = KBackgroundSettings::InOrder;
// Wallpaper Position
m_prevWallpaperPos = KBackgroundSettings::ScaleAndCrop;
m_prevTilePos = KBackgroundSettings::Tiled;
m_wallpaperPos = eRenderer()->wallpaperMode();
if (m_wallpaperPos == KBackgroundSettings::NoWallpaper)
m_wallpaperPos = KBackgroundSettings::Centred; // Default
const TQString path = eRenderer()->wallpaper();
KFileMetaInfo metaInfo(path);
if (metaInfo.isValid() && metaInfo.item("Dimensions").isValid())
{
// If the image is greater than 800x600 default to using the user selected mode
// for a normal wallpaper, otherwise default to user selection for tiles.
TQSize s = metaInfo.item("Dimensions").value().toSize();
m_isTile = (s.width() < 800 || s.height() < 600);
if (m_isTile)
{
m_prevTilePos = m_wallpaperPos;
}
else
{
m_prevWallpaperPos = m_wallpaperPos;
}
}
else if (KMimeType::findByPath(path)->is("image/svg+xml"))
{
m_prevWallpaperPos = m_wallpaperPos;
}
// Restrictions
if (TDEGlobal::dirs()->isRestrictedResource("wallpaper"))
{
m_urlWallpaperButton->hide();
@ -940,18 +965,22 @@ void BGDialog::slotWallpaperTypeChanged(int i)
KFileMetaInfo metaInfo(path);
if (metaInfo.isValid() && metaInfo.item("Dimensions").isValid())
{
// If the image is greater than 800x600 default to using scaled mode,
// otherwise default to tiled.
// If the image is greater than 800x600 default to using the user selected mode
// for a normal wallpaper, otherwise default to user selection for tiles.
TQSize s = metaInfo.item("Dimensions").value().toSize();
if (s.width() >= 800 && s.height() >= 600)
m_wallpaperPos = KBackgroundSettings::Scaled;
m_isTile = (s.width() < 800 || s.height() < 600);
if (m_isTile)
{
m_wallpaperPos = m_prevTilePos;
}
else
m_wallpaperPos = KBackgroundSettings::Tiled;
{
m_wallpaperPos = m_prevWallpaperPos;
}
}
else if (KMimeType::findByPath(path)->is("image/svg+xml"))
{
m_wallpaperPos = KBackgroundSettings::Scaled;
m_wallpaperPos = m_prevWallpaperPos;
}
r->setWallpaperMode(m_wallpaperPos);
@ -998,6 +1027,15 @@ void BGDialog::slotWallpaperPos(int mode)
if (mode == r->wallpaperMode())
return;
if (m_isTile)
{
m_prevTilePos = mode;
}
else
{
m_prevWallpaperPos = mode;
}
r->stop();
r->setWallpaperMode(mode);
r->start(true);

@ -99,8 +99,11 @@ protected:
TQValueVector< TQPtrVector<KBackgroundRenderer> > m_renderer; // m_renderer[desk][screen]
TQMap<TQString,int> m_wallpaper;
TQStringList m_patterns;
int m_slideShowRandom; // Remembers last Slide Show setting
int m_wallpaperPos; // Remembers last wallpaper pos
int m_slideShowRandom; // Remembers last Slide Show setting
int m_wallpaperPos; // Remembers last wallpaper pos
int m_prevWallpaperPos; // Previous normal wallpaper pos
int m_prevTilePos; // Previous tile wallpaper pos
bool m_isTile; // Whether the wallpaper is a tile (800x600 or smaller)
BGMonitorArrangement * m_pMonitorArrangement;

@ -1,14 +1,44 @@
[Desktop Entry]
X-TDE-ServiceTypes=image/*
Actions=setAsBackground;tileAsBackground;
Actions=centeredAsBackground;tiledAsBackground;centeredTiledAsBackground;centeredMaxpectAsBackground;tiledMaxpectAsBackground;scaledAsBackground;centeredAutoFitAsBackground;scaleAndCropAsBackground
X-TDE-Submenu=Set as Background
[Desktop Action setAsBackground]
[Desktop Action centeredAsBackground]
Name=Centered
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 6
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 1
[Desktop Action tileAsBackground]
[Desktop Action tiledAsBackground]
Name=Tiled
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 2
[Desktop Action centeredTiledAsBackground]
Name=Center Tiled
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 3
[Desktop Action centeredMaxpectAsBackground]
Name=Centered Maxpect
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 4
[Desktop Action tiledMaxpectAsBackground]
Name=Tiled Maxpect
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 5
[Desktop Action scaledAsBackground]
Name=Scaled
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 6
[Desktop Action centeredAutoFitAsBackground]
Name=Centered Auto Fit
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 7
[Desktop Action scaleAndCropAsBackground]
Name=Scale & Crop
Icon=background
Exec=dcop kdesktop KBackgroundIface setWallpaper %u 8

@ -689,7 +689,7 @@ void KEyeCandyPage::getUserDefaults(){
st_UserWallpaper.CommonDesktop = kdesktopconf->readBoolEntry("CommonDesktop", true);
kdesktopconf->setGroup("Desktop0"); // we only need to set one desktop
st_UserWallpaper.MultiWallpaperMode = kdesktopconf->readEntry("MultiWallpaperMode", "NoMulti");
st_UserWallpaper.WallpaperMode = kdesktopconf->readEntry("WallpaperMode", "Scaled");
st_UserWallpaper.WallpaperMode = kdesktopconf->readEntry("WallpaperMode", "ScaledAndCrop");
st_UserWallpaper.Wallpaper = kdesktopconf->readPathEntry("Wallpaper", "NoWallpaper");
deskbgimage = kdesktopconf->readPathEntry("Wallpaper", DEFAULT_WALLPAPER);
// Wallpaper-User-Defaults (END)

@ -89,8 +89,10 @@ KWinbindGreeter::KWinbindGreeter( KGreeterPluginHandler *_handler,
themer = 0;
if (!themer)
{
grid = new TQGridLayout( 0, 0, 10 );
layoutItem = TQT_TQLAYOUTITEM(grid);
}
domainLabel = loginLabel = passwdLabel = passwd1Label = passwd2Label = 0;
domainCombo = 0;

Loading…
Cancel
Save