summaryrefslogtreecommitdiffstats
path: root/kdesktop/krootwm.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2021-03-05 15:34:53 +0200
committerMavridis Philippe <[email protected]>2021-03-30 16:39:25 +0300
commit94b98729138c6948c1e4fdbb1e0552f85783f263 (patch)
tree5e0b741dc58c987c5468c750d80f6e14d20cafcb /kdesktop/krootwm.cpp
parentf06c728734b0102b131395f297de60877d4d0a66 (diff)
downloadtdebase-94b98729138c6948c1e4fdbb1e0552f85783f263.tar.gz
tdebase-94b98729138c6948c1e4fdbb1e0552f85783f263.zip
KDesktop: customizable icon spacing.
This commit introduces changes to KDesktop which allow for a custom icon spacing option, some new controls into the Desktop Behaviour module of KControl, as well as the KDesktop Ctrl+Mouse Scroll binding to manipulate the icon spacing. This commit depends on a previous (minor) change in LibKonq. Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'kdesktop/krootwm.cpp')
-rw-r--r--kdesktop/krootwm.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/kdesktop/krootwm.cpp b/kdesktop/krootwm.cpp
index e5b4b76e0..4010c1f22 100644
--- a/kdesktop/krootwm.cpp
+++ b/kdesktop/krootwm.cpp
@@ -109,7 +109,7 @@ KRootWm::KRootWm(SaverEngine* _saver, KDesktop* _desktop) : TQObject(_desktop),
bookmarks = 0;
bookmarkMenu = 0;
}
-
+
// The windowList and desktop menus can be part of a menubar (Mac style)
// so we create them here
desktopMenu = new TQPopupMenu;
@@ -250,7 +250,7 @@ void KRootWm::initConfig()
if ( m_bDesktopEnabled ) {
m_pDesktop->iconView()->setAutoAlign( KDesktopSettings::autoLineUpIcons() );
if ( kapp->authorize( "editable_desktop_icons" ) ) {
- m_pDesktop->iconView()->setItemsMovable( !KDesktopSettings::lockIcons() );
+ m_pDesktop->iconView()->setIconsLocked( KDesktopSettings::lockIcons() );
TDEToggleAction *aLockIcons = static_cast<TDEToggleAction*>(m_actionCollection->action("lock_icons"));
if (aLockIcons)
aLockIcons->setChecked( KDesktopSettings::lockIcons() );
@@ -732,12 +732,24 @@ void KRootWm::slotLineupIcons() {
void KRootWm::slotToggleLockIcons( bool lock )
{
- if (m_bDesktopEnabled)
- {
- m_pDesktop->iconView()->setItemsMovable( !lock );
- KDesktopSettings::setLockIcons( lock );
- KDesktopSettings::writeConfig();
- }
+ KDesktopSettings::setLockIcons( lock );
+ KDesktopSettings::writeConfig();
+
+ // Also save it globally...
+ int desktop = TDEApplication::desktop()->primaryScreen();
+ TQCString cfilename;
+ if (desktop == 0)
+ cfilename = "kdesktoprc";
+ else
+ cfilename.sprintf("kdesktop-screen-%drc", desktop);
+
+ TDEConfig *kdg_config = new TDEConfig(cfilename, false, false);
+ kdg_config->setGroup( "General" );
+ kdg_config->writeEntry( "LockIcons", lock );
+ kdg_config->sync();
+ delete kdg_config;
+
+ m_pDesktop->iconView()->setIconsLocked( lock );
}
void KRootWm::slotRefreshDesktop() {