diff options
author | Mavridis Philippe <[email protected]> | 2021-03-05 15:34:53 +0200 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2021-03-30 22:44:39 +0900 |
commit | e462d99db6350ca0811900e714b78b48d04ab650 (patch) | |
tree | 451472f6dc9fb5879055ad9b82368027998d85c0 /kdesktop/krootwm.cpp | |
parent | 3c1547635df0c6eb61a9693af90143d0cf04f79c (diff) | |
download | tdebase-e462d99db6350ca0811900e714b78b48d04ab650.tar.gz tdebase-e462d99db6350ca0811900e714b78b48d04ab650.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]>
(cherry picked from commit 94b98729138c6948c1e4fdbb1e0552f85783f263)
Diffstat (limited to 'kdesktop/krootwm.cpp')
-rw-r--r-- | kdesktop/krootwm.cpp | 28 |
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() { |