From 5c5b15810baec6b97f1bf3989b8ae6201f8a70b4 Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:55:53 -0800 Subject: [PATCH 1/2] Fix IconButton Caravan Issue --- Dalamud/Interface/Components/ImGuiComponents.IconButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs b/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs index 7ef3f56e5..cee5c5390 100644 --- a/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs +++ b/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs @@ -55,7 +55,7 @@ public static partial class ImGuiComponents /// The color of the button when hovered. /// Indicator if button is clicked. public static bool IconButton(int id, FontAwesomeIcon icon, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null) - => IconButton($"{icon.ToIconString()}{id}", defaultColor, activeColor, hoveredColor); + => IconButton($"{icon.ToIconString()}##{id}", defaultColor, activeColor, hoveredColor); /// /// IconButton component to use an icon as a button with color options. From 9beea2186460b5fe5797d3d2f4f8d774f4259acf Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Thu, 12 Jan 2023 14:56:21 -0800 Subject: [PATCH 2/2] Add IconButton overloads --- .../Components/ImGuiComponents.IconButton.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs b/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs index cee5c5390..99e43d68c 100644 --- a/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs +++ b/Dalamud/Interface/Components/ImGuiComponents.IconButton.cs @@ -26,6 +26,15 @@ public static partial class ImGuiComponents public static bool IconButton(int id, FontAwesomeIcon icon) => IconButton(id, icon, null, null, null); + /// + /// IconButton component to use an icon as a button. + /// + /// The ID of the button. + /// The icon for the button. + /// Indicator if button is clicked. + public static bool IconButton(string id, FontAwesomeIcon icon) + => IconButton(id, icon, null, null, null); + /// /// IconButton component to use an icon as a button. /// @@ -57,6 +66,18 @@ public static partial class ImGuiComponents public static bool IconButton(int id, FontAwesomeIcon icon, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null) => IconButton($"{icon.ToIconString()}##{id}", defaultColor, activeColor, hoveredColor); + /// + /// IconButton component to use an icon as a button with color options. + /// + /// The ID of the button. + /// The icon for the button. + /// The default color of the button. + /// The color of the button when active. + /// The color of the button when hovered. + /// Indicator if button is clicked. + public static bool IconButton(string id, FontAwesomeIcon icon, Vector4? defaultColor = null, Vector4? activeColor = null, Vector4? hoveredColor = null) + => IconButton($"{icon.ToIconString()}##{id}", defaultColor, activeColor, hoveredColor); + /// /// IconButton component to use an icon as a button with color options. ///