diff --git a/src/DearImGui.hs b/src/DearImGui.hs index e6c4cf6..2a9bdea 100644 --- a/src/DearImGui.hs +++ b/src/DearImGui.hs @@ -87,6 +87,9 @@ module DearImGui , openPopup , closeCurrentPopup + -- * Item/Widgets Utilities + , isItemHovered + -- * Types , ImGuiDir , pattern ImGuiDirLeft @@ -533,6 +536,14 @@ closeCurrentPopup = liftIO do [C.exp| void { CloseCurrentPopup() } |] +-- | Is the last item hovered? (and usable, aka not blocked by a popup, etc.). +-- +-- Wraps @ImGui::IsItemHovered()@ +isItemHovered :: MonadIO m => m Bool +isItemHovered = liftIO do + (1 ==) <$> [C.exp| bool { IsItemHovered() } |] + + -- | A cardinal direction. newtype ImGuiDir = ImGuiDir CInt