psifidotos / workflow-project

This is an effort to create a KDE Plasmoid that integrates the main Activities, Virtual Desktops and Tasks Functionalities from Plasma Desktop in just one component.
http://workflow.opentoolsandspace.org/
GNU General Public License v2.0
11 stars 2 forks source link

Use escape key to hide plasmoid #68

Closed bmihaila closed 11 years ago

bmihaila commented 11 years ago

Hi

Now that the keyboard navigation is in and I start using it more and more (one could maybe add some windows moving keys there but I digress ...) I caught myself pressing quite often the escape key with the intent to hide the plasmoid. As at the moment it is not bound for that function I propose to add this functionality.

I added it with this patch which takes care to first close the search filter field and only then closes the plasmoid if esc is pressed again:

--- KeyNavigation.qml.orig  2013-02-06 11:52:40.000000000 +0100
+++ KeyNavigation.qml   2013-02-09 17:30:37.110006110 +0100
@@ -36,7 +36,16 @@
     Keys.onDownPressed: {downPressed(); }
     Keys.onReturnPressed: returnPressed();
     Keys.onEnterPressed: returnPressed();
-    Keys.onEscapePressed: {isActive = false; filterCalled = false;}
+    Keys.onEscapePressed: {
+        if (filterCalled) {
+            isActive = false; 
+            filterCalled = false;
+        } else {
+            plasmoid.hidePopup();
+            if(!plasmoidWrapper.isInPanel)
+                taskManager.hideDashboard();
+        }
+    }
     Keys.onPressed: {
         if(event.key === Qt.Key_H)
             leftPressed();
psifidotos commented 11 years ago

Oh, you have searched the code a lot... :) you could make a pull request directly from github but I dont know how (of course the patch is accepted)... Michael (james147) has sent me many patched this way....

bmihaila commented 11 years ago

Hehe, yep wanted to not break things. Also am trying to get accustomed to the codebase to implement the feature requests ideas myself if possible without bugging you ;).

Yep, should have made a pull request but did not find out how without forking the code and that would be a bit too much for this tiny feature. Will see if I can find the patch submission still.