some adhoc event handling to unify L&F button focus behavior, e.g. Mac OS X vs. Nimbus;
authorwenzelm
Mon May 19 15:23:08 2014 +0200 (2014-05-19)
changeset 57000c914618feef8
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
     1.1 --- a/src/Tools/jEdit/src/query_dockable.scala	Mon May 19 15:00:11 2014 +0200
     1.2 +++ b/src/Tools/jEdit/src/query_dockable.scala	Mon May 19 15:23:08 2014 +0200
     1.3 @@ -251,7 +251,13 @@
     1.4  
     1.5      private val apply_button = new Button("<html><b>Apply</b></html>") {
     1.6        tooltip = "Apply to current context"
     1.7 -      reactions += { case ButtonClicked(_) => apply_query() }
     1.8 +      listenTo(keys)
     1.9 +      reactions += {
    1.10 +        case ButtonClicked(_) => apply_query()
    1.11 +        case evt @ KeyPressed(_, Key.Enter, 0, _) =>
    1.12 +          evt.peer.consume
    1.13 +          apply_query()
    1.14 +      }
    1.15      }
    1.16  
    1.17      private val control_panel = new Wrap_Panel(Wrap_Panel.Alignment.Right)()