Skip to content

Commit

Permalink
allowMousePickOutsideEvent/preventMousePickOutsideEvent are now switc…
Browse files Browse the repository at this point in the history
…hed on popup window open/close
  • Loading branch information
plantec committed Nov 4, 2024
1 parent 639b020 commit b520ac4
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Toplo-Widget-Menu/ToMenuWindow.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #ToMenuWindow,
#superclass : #ToAnchoredWindow,
#superclass : #ToPopupWindow,
#instVars : [
'openedSubmenuWindow'
],
Expand Down
2 changes: 1 addition & 1 deletion src/Toplo-Widget-Select/ToSelectPopupWindow.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #ToSelectPopupWindow,
#superclass : #ToAnchoredWindow,
#superclass : #ToPopupWindow,
#category : #'Toplo-Widget-Select-List'
}

Expand Down
7 changes: 5 additions & 2 deletions src/Toplo/BlElement.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,15 @@ BlElement >> stillPressedStartDelay [

{ #category : #'*Toplo' }
BlElement >> stillPressedStartDelay: aDuration [

" must have a skin state generator "

self userData at: #stillPressedStartDelay put: aDuration asDuration.
self flag: 'To check'.
" one have to allow mouse pick outside event to make it possible stopping
the dedicated task from the skin state generator (ToSkinStateGenerator) "
aDuration ifNil: [ self preventMousePickOutsideEvent ] ifNotNil: [ self allowMousePickOutsideEvent ]
aDuration
ifNil: [ self preventMousePickOutsideEvent ]
ifNotNil: [ self allowMousePickOutsideEvent ]
]

{ #category : #'*Toplo' }
Expand Down
19 changes: 19 additions & 0 deletions src/Toplo/ToPopupWindow.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Class {
#name : #ToPopupWindow,
#superclass : #ToAnchoredWindow,
#category : #'Toplo-Core-Window'
}

{ #category : #'api - displaying' }
ToPopupWindow >> close [

windowManager element preventMousePickOutsideEvent.
super close
]

{ #category : #'api - displaying' }
ToPopupWindow >> popupEvent: anEvent [

windowManager element allowMousePickOutsideEvent.
^ super popupEvent: anEvent
]
7 changes: 0 additions & 7 deletions src/Toplo/ToPopupWindowManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ ToPopupWindowManager >> mouseUpOutsideEvent: anEvent [
self pickOutsideEvent: anEvent
]

{ #category : #'api - hooks' }
ToPopupWindowManager >> onInstalledIn: anElement [

super onInstalledIn: anElement.
anElement allowMousePickOutsideEvent.
]

{ #category : #'event handling' }
ToPopupWindowManager >> pickOutsideEvent: anEvent [
"
Expand Down
2 changes: 1 addition & 1 deletion src/Toplo/ToTooltipWindow.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #ToTooltipWindow,
#superclass : #ToAnchoredWindow,
#superclass : #ToPopupWindow,
#category : #'Toplo-Core-Tooltip'
}

Expand Down

0 comments on commit b520ac4

Please sign in to comment.