From 369910865ad9a6ef60694147c1a3152d2dca5065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 28 Jun 2009 20:32:50 +0000 Subject: [PATCH] Add "show desktop" to screen edges. FEATURE: 195359 svn path=/trunk/KDE/kdebase/workspace/; revision=988839 --- kcmkwin/kwinscreenedges/main.cpp | 3 +++ lib/kwinglobals.h | 1 + options.cpp | 1 + workspace.cpp | 5 +++++ 4 files changed, 10 insertions(+) diff --git a/kcmkwin/kwinscreenedges/main.cpp b/kcmkwin/kwinscreenedges/main.cpp index 7ce957c1f9..cecdc46512 100644 --- a/kcmkwin/kwinscreenedges/main.cpp +++ b/kcmkwin/kwinscreenedges/main.cpp @@ -170,6 +170,7 @@ void KWinScreenEdgesConfig::monitorInit() { monitorAddItem( i18n( "No Action" )); monitorAddItem( i18n( "Show Dashboard" )); + monitorAddItem( i18n( "Show Desktop" )); // Search the effect names KServiceTypeTrader* trader = KServiceTypeTrader::self(); @@ -298,6 +299,8 @@ void KWinScreenEdgesConfig::monitorSaveAction( int edge, const QString& configNa int item = m_ui->monitor->selectedEdgeItem( edge ); if( item == 1 ) // Plasma dashboard config.writeEntry( configName, "Dashboard" ); + else if( item == 2 ) + config.writeEntry( configName, "ShowDesktop" ); else // Anything else config.writeEntry( configName, "None" ); } diff --git a/lib/kwinglobals.h b/lib/kwinglobals.h index d145e9e761..f5113dd5bc 100644 --- a/lib/kwinglobals.h +++ b/lib/kwinglobals.h @@ -80,6 +80,7 @@ enum ElectricBorderAction { ElectricActionNone, // No special action, not set, desktop switch or an effect ElectricActionDashboard, // Launch the Plasma dashboard + ElectricActionShowDesktop, // Show desktop or restore ELECTRIC_ACTION_COUNT }; diff --git a/options.cpp b/options.cpp index 8d9459b62f..0c381e643e 100644 --- a/options.cpp +++ b/options.cpp @@ -263,6 +263,7 @@ ElectricBorderAction Options::electricBorderAction( const QString& name ) { QString lowerName = name.toLower(); if( lowerName == "dashboard" ) return ElectricActionDashboard; + else if( lowerName == "showdesktop" ) return ElectricActionShowDesktop; return ElectricActionNone; } diff --git a/workspace.cpp b/workspace.cpp index a02c4c4153..3888727a9e 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -2174,6 +2174,11 @@ void Workspace::checkElectricBorder(const QPoint& pos, Time now) plasmaApp.call( "toggleDashboard" ); } break; + case ElectricActionShowDesktop: + { + setShowingDesktop( !showingDesktop() ); + break; + } case ElectricActionNone: // Either desktop switching or an effect default: {