MCPcopy Create free account
hub / github.com/antopilo/Nuake / DrawButtonImage

Function DrawButtonImage

Nuake/Source/Nuake/UI/ImUI.cpp:221–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219 }
220
221 void DrawButtonImage(const Ref<VulkanImage>& imageNormal, const Ref<VulkanImage>& imageHovered, const Ref<VulkanImage>& imagePressed,
222 ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed,
223 ImVec2 rectMin, ImVec2 rectMax)
224 {
225 auto* drawList = ImGui::GetForegroundDrawList();
226 if (ImGui::IsItemActive())
227 drawList->AddImage((ImTextureID)imagePressed->GetImGuiDescriptorSet(), rectMin, rectMax, ImVec2(0, 0), ImVec2(1, 1), tintPressed);
228 else if (ImGui::IsItemHovered())
229 drawList->AddImage((ImTextureID)imagePressed->GetImGuiDescriptorSet(), rectMin, rectMax, ImVec2(0, 0), ImVec2(1, 1), tintHovered);
230 else
231 drawList->AddImage((ImTextureID)imagePressed->GetImGuiDescriptorSet(), rectMin, rectMax, ImVec2(0, 0), ImVec2(1, 1), tintNormal);
232 };
233
234 void DrawButtonImage(const Ref<VulkanImage>& imageNormal, const Ref<VulkanImage>& imageHovered, const Ref<VulkanImage>& imagePressed,
235 ImU32 tintNormal, ImU32 tintHovered, ImU32 tintPressed,

Callers 1

DrawTitlebarMethod · 0.85

Calls 3

GetForegroundDrawListFunction · 0.85
AddImageMethod · 0.80
ImVec2Function · 0.50

Tested by

no test coverage detected