From c5ee667f72962c9b7c4e3a2608abc157bf602e58 Mon Sep 17 00:00:00 2001 From: Jonathan Daugherty Date: Thu, 12 May 2022 08:14:27 -0700 Subject: [PATCH] Mouse demo: improve click message slightly --- programs/MouseDemo.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/programs/MouseDemo.hs b/programs/MouseDemo.hs index 94a115d..dc3d127 100644 --- a/programs/MouseDemo.hs +++ b/programs/MouseDemo.hs @@ -77,11 +77,13 @@ infoLayer st = T.Widget T.Fixed T.Fixed $ do c <- T.getContext let h = c^.T.availHeightL msg = case st^.lastReportedClick of - Nothing -> "nothing" - Just (name, T.Location l) -> show name <> " at " <> show l + Nothing -> + "Click and hold/drag to report a mouse click" + Just (name, T.Location l) -> + "Mouse down at " <> show name <> " @ " <> show l T.render $ translateBy (T.Location (0, h-1)) $ clickable Info $ withDefAttr "info" $ - C.hCenter (str ("Last reported click: " <> msg)) + C.hCenter $ str msg appEvent :: St -> T.BrickEvent Name e -> T.EventM Name (T.Next St) appEvent st (T.MouseDown n _ _ loc) = do