Skip to content

Commit

Permalink
Hide tooltip when a button action is detected on its child widget (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjvallarino committed Jun 16, 2022
1 parent 69f68ff commit fa52649
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Monomer/Widgets/Containers/Tooltip.hs
Expand Up @@ -149,6 +149,14 @@ makeTooltip caption config state = widget where
result = resultNode newNode

handleEvent wenv node target evt = case evt of
ButtonAction{} -> Just $ resultReqs newNode [RenderOnce] where
newState = state {
_ttsLastPos = Point (-1) (-1),
_ttsLastPosTs = maxBound
}
newNode = node
& L.widget .~ makeTooltip caption config newState

Leave point -> Just $ resultReqs newNode [RenderOnce] where
newState = state {
_ttsLastPos = Point (-1) (-1),
Expand Down

0 comments on commit fa52649

Please sign in to comment.