Skip to content

Commit 4ca9a3d

Browse files
committed
Wrap ImGui::IsItemHovered()
1 parent 93b729d commit 4ca9a3d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/DearImGui.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ module DearImGui
8787
, openPopup
8888
, closeCurrentPopup
8989

90+
-- * Item/Widgets Utilities
91+
, isItemHovered
92+
9093
-- * Types
9194
, ImGuiDir
9295
, pattern ImGuiDirLeft
@@ -533,6 +536,14 @@ closeCurrentPopup = liftIO do
533536
[C.exp| void { CloseCurrentPopup() } |]
534537

535538

539+
-- | Is the last item hovered? (and usable, aka not blocked by a popup, etc.).
540+
--
541+
-- Wraps @ImGui::IsItemHovered()@
542+
isItemHovered :: MonadIO m => m Bool
543+
isItemHovered = liftIO do
544+
(1 ==) <$> [C.exp| bool { IsItemHovered() } |]
545+
546+
536547
-- | A cardinal direction.
537548
newtype ImGuiDir = ImGuiDir CInt
538549

0 commit comments

Comments
 (0)