mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
add fixed-width font option to icon test widget
This commit is contained in:
parent
d98708e9a8
commit
0d7c8f1bd2
1 changed files with 4 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
|
||||||
private int selectedIconCategory;
|
private int selectedIconCategory;
|
||||||
private string iconSearchInput = string.Empty;
|
private string iconSearchInput = string.Empty;
|
||||||
private bool iconSearchChanged = true;
|
private bool iconSearchChanged = true;
|
||||||
|
private bool useFixedWidth = false;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string[]? CommandShortcuts { get; init; } = { "fa", "fatest", "fontawesome" };
|
public string[]? CommandShortcuts { get; init; } = { "fa", "fatest", "fontawesome" };
|
||||||
|
|
@ -81,6 +82,8 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
|
||||||
this.iconSearchChanged = true;
|
this.iconSearchChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Checkbox("Use fixed width font", ref this.useFixedWidth);
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(10f);
|
ImGuiHelpers.ScaledDummy(10f);
|
||||||
for (var i = 0; i < this.icons?.Count; i++)
|
for (var i = 0; i < this.icons?.Count; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -88,7 +91,7 @@ internal class FontAwesomeTestWidget : IDataWindowWidget
|
||||||
ImGuiHelpers.ScaledRelativeSameLine(50f);
|
ImGuiHelpers.ScaledRelativeSameLine(50f);
|
||||||
ImGui.Text($"{this.iconNames?[i]}");
|
ImGui.Text($"{this.iconNames?[i]}");
|
||||||
ImGuiHelpers.ScaledRelativeSameLine(280f);
|
ImGuiHelpers.ScaledRelativeSameLine(280f);
|
||||||
ImGui.PushFont(UiBuilder.IconFont);
|
ImGui.PushFont(this.useFixedWidth ? InterfaceManager.IconFontFixedWidth : InterfaceManager.IconFont);
|
||||||
ImGui.Text(this.icons[i].ToIconString());
|
ImGui.Text(this.icons[i].ToIconString());
|
||||||
ImGui.PopFont();
|
ImGui.PopFont();
|
||||||
ImGuiHelpers.ScaledDummy(2f);
|
ImGuiHelpers.ScaledDummy(2f);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue