mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: Add HelpMarker with custom icon (#1588)
This commit is contained in:
parent
eb5fa24101
commit
d36106fa30
1 changed files with 9 additions and 2 deletions
|
|
@ -11,11 +11,18 @@ public static partial class ImGuiComponents
|
|||
/// HelpMarker component to add a help icon with text on hover.
|
||||
/// </summary>
|
||||
/// <param name="helpText">The text to display on hover.</param>
|
||||
public static void HelpMarker(string helpText)
|
||||
public static void HelpMarker(string helpText) => HelpMarker(helpText, FontAwesomeIcon.InfoCircle);
|
||||
|
||||
/// <summary>
|
||||
/// HelpMarker component to add a custom icon with text on hover.
|
||||
/// </summary>
|
||||
/// <param name="helpText">The text to display on hover.</param>
|
||||
/// <param name="icon">The icon to use.</param>
|
||||
public static void HelpMarker(string helpText, FontAwesomeIcon icon)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.PushFont(UiBuilder.IconFont);
|
||||
ImGui.TextDisabled(FontAwesomeIcon.InfoCircle.ToIconString());
|
||||
ImGui.TextDisabled(icon.ToIconString());
|
||||
ImGui.PopFont();
|
||||
if (!ImGui.IsItemHovered()) return;
|
||||
ImGui.BeginTooltip();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue