#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Wed, 06 Mar 2019 11:42:00 +0100
changeset 6029 8b004782d14f
parent 6028 e2b64ee3f94e
child 6030 9e4e79cbc322
#UI_ENHANCEMENT by cg class: MenuPanel changed: #handleButtonMotion:atPoint: if no menu is currently open, show a submenu immediately.
MenuPanel.st
--- a/MenuPanel.st	Tue Mar 05 23:21:10 2019 +0100
+++ b/MenuPanel.st	Wed Mar 06 11:42:00 2019 +0100
@@ -3884,8 +3884,9 @@
 handleButtonMotion:state atPoint:motionPoint
     "open or close the corresponding submenus"
 
-    |menu item translatedPoint containsPoint direction delayTime|
-
+    |menu item translatedPoint containsPoint direction delayTime
+     visibleSubmenu point|
+     
     false ifTrue:[
         state == 0 ifTrue:[
             "/ no button currently pressed
@@ -3902,8 +3903,6 @@
         "/ current selection
         item := items detect:[:el| el visibleSubmenu notNil ] ifNone:nil.
         item notNil ifTrue:[
-            |visibleSubmenu point|
-
             visibleSubmenu := item visibleSubmenu.
             visibleSubmenu notNil ifTrue:[
                 point := self translateMenuPoint:motionPoint toMenu:visibleSubmenu.
@@ -3931,7 +3930,8 @@
         
         (self topMenu activeMenu isNil or:[self topMenu activeMenu == self]) ifTrue:[
             "/ no menu open currently
-            delayTime := 0.1.
+            "/ delayTime := 0.1.
+            delayTime := 0.
         ].
     ].
 
@@ -3992,7 +3992,7 @@
     ].
 
     "Modified: / 15-03-2017 / 20:41:07 / stefan"
-    "Modified: / 18-02-2019 / 14:07:56 / Claus Gittinger"
+    "Modified: / 06-03-2019 / 11:39:19 / Claus Gittinger"
 !
 
 handleButtonPress:button atPoint:aPoint