some adhoc event handling to unify L&F button focus behavior, e.g. Mac OS X vs. Nimbus;
authorwenzelm
Mon, 19 May 2014 15:23:08 +0200
changeset 57000 c914618feef8
parent 56999 d926fc73b554
child 57001 db2e51a80ab5
some adhoc event handling to unify L&F button focus behavior, e.g. Mac OS X vs. Nimbus;
src/Tools/jEdit/src/query_dockable.scala
--- a/src/Tools/jEdit/src/query_dockable.scala	Mon May 19 15:00:11 2014 +0200
+++ b/src/Tools/jEdit/src/query_dockable.scala	Mon May 19 15:23:08 2014 +0200
@@ -251,7 +251,13 @@
 
     private val apply_button = new Button("<html><b>Apply</b></html>") {
       tooltip = "Apply to current context"
-      reactions += { case ButtonClicked(_) => apply_query() }
+      listenTo(keys)
+      reactions += {
+        case ButtonClicked(_) => apply_query()
+        case evt @ KeyPressed(_, Key.Enter, 0, _) =>
+          evt.peer.consume
+          apply_query()
+      }
     }
 
     private val control_panel = new Wrap_Panel(Wrap_Panel.Alignment.Right)()