@@ -86,13 +86,13 @@ default boolean isOnButton(Point location) {
86
86
}
87
87
88
88
/**
89
- * Indicates if the given location is on the arrow area of the {@link ToolItem}.
89
+ * Indicates the popup location if the given location is on the arrow area of the {@link ToolItem}.
90
90
*
91
91
* @param location The location to check.
92
- * @return true if on the arrow are, false otherwise.
92
+ * @return the popup location (bottom-left corner of the main button), if the specified location is over the arrow, null otherwise.
93
93
*/
94
- default boolean isOnArrow (Point location ) {
95
- return false ;
94
+ default Point getOnArrowLocation (Point location ) {
95
+ return null ;
96
96
}
97
97
}
98
98
@@ -904,15 +904,18 @@ public boolean notifyMouseDown(Point location) {
904
904
MouseState newState ;
905
905
if (renderer .isOnButton (location )) {
906
906
newState = MouseState .DOWN ;
907
- } else if (renderer .isOnArrow (location )) {
908
- newState = MouseState .IDLE ;
909
- Event event = new Event ();
910
- event .detail = SWT .ARROW ;
911
- event .setLocation (location .x , location .y );
912
- event .stateMask |= SWT .NO_FOCUS ;
913
- sendEvent (SWT .Selection , event );
914
907
} else {
915
- newState = MouseState .IDLE ;
908
+ final Point onArrowLocation = renderer .getOnArrowLocation (location );
909
+ if (onArrowLocation != null ) {
910
+ newState = MouseState .IDLE ;
911
+ Event event = new Event ();
912
+ event .detail = SWT .ARROW ;
913
+ event .setLocation (onArrowLocation .x , onArrowLocation .y );
914
+ event .stateMask |= SWT .NO_FOCUS ;
915
+ sendEvent (SWT .Selection , event );
916
+ } else {
917
+ newState = MouseState .IDLE ;
918
+ }
916
919
}
917
920
918
921
return updateMouseState (newState );
0 commit comments