From 94b98729138c6948c1e4fdbb1e0552f85783f263 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 5 Mar 2021 15:34:53 +0200 Subject: 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 --- kdesktop/krootwm.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'kdesktop/krootwm.cpp') 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(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() { -- cgit v1.2.1