Continue mouse context refactor

This commit is contained in:
2024-11-18 22:21:12 +00:00
parent 69fe28afe7
commit 5b709cd7ba
7 changed files with 186 additions and 165 deletions
+7 -5
View File
@@ -389,8 +389,9 @@ shiftInvItemsDown (_, i) x w = fromMaybe w $ do
g i' m = fst <$> IM.lookupGT i' m
updateMouseContext :: Configuration -> Universe -> Universe
updateMouseContext cfig u =
u & uvWorld . input . mouseContext
updateMouseContext cfig u = case u ^. uvWorld . input . mouseContext of
OverInvDrag -> u
_ -> u & uvWorld . input . mouseContext
.~ fromMaybe
aimcontext
(overmenu <|> overinv <|> overcomb <|> overterm)
@@ -440,9 +441,10 @@ updateMouseContext cfig u =
return $
if isOverTerminalScreen cfig tm mpos
then
if null $ tm ^. tmInput . tiText
then NoMouseContext
else OverTerminalReturn
fromMaybe NoMouseContext $ do
let s = tm ^. tmInput . tiText
guard $ not (null s) && _tmStatus tm == TerminalReady
return $ OverTerminalReturn tmid
else OverTerminalEscape
isOverTerminalScreen :: Configuration -> Terminal -> Point2 -> Bool