Update icon alignment

master
Liza 2023-10-11 03:14:01 +02:00
parent a8861ce40a
commit e7f5017cbf
Signed by: liza
GPG Key ID: 7199F8D727D55F67
3 changed files with 17 additions and 6 deletions

View File

@ -27,7 +27,7 @@ partial class LImGui
private static float _headerCurrentPos = 0; private static float _headerCurrentPos = 0;
private static float _headerImGuiButtonWidth = 0; private static float _headerImGuiButtonWidth = 0;
public static bool AddHeaderIcon(DalamudPluginInterface pluginInterface, string id, FontAwesomeIcon icon, HeaderIconOptions options = null) public static bool AddHeaderIcon(DalamudPluginInterface pluginInterface, string id, FontAwesomeIcon icon, HeaderIconOptions? options = null)
{ {
if (ImGui.IsWindowCollapsed()) return false; if (ImGui.IsWindowCollapsed()) return false;
@ -45,6 +45,13 @@ partial class LImGui
_headerImGuiButtonWidth += 17 * scale; _headerImGuiButtonWidth += 17 * scale;
if (!GetCurrentWindowFlags().HasFlag(ImGuiWindowFlags.NoCollapse)) if (!GetCurrentWindowFlags().HasFlag(ImGuiWindowFlags.NoCollapse))
_headerImGuiButtonWidth += 17 * scale; _headerImGuiButtonWidth += 17 * scale;
if (!CurrentWindowHasCloseButton() &&
GetCurrentWindowFlags().HasFlag(ImGuiWindowFlags.NoCollapse) &&
GetCurrentWindowFlags().HasFlag(ImGuiWindowFlags.AlwaysAutoResize))
_headerImGuiButtonWidth += 5 * scale;
else
_headerImGuiButtonWidth += 10 * scale;
} }
options ??= new(); options ??= new();

View File

@ -12,17 +12,15 @@ public static partial class LImGui
{ {
if (AddHeaderIcon(pluginInterface, "##Patreon", FontAwesomeIcon.Heart, new HeaderIconOptions if (AddHeaderIcon(pluginInterface, "##Patreon", FontAwesomeIcon.Heart, new HeaderIconOptions
{ {
Tooltip = "Open Liza's page on Patreon", Tooltip = "Go to patreon.com/lizac",
Color = 0xFF000FF, Color = 0xFF3030D0,
Offset = Vector2.Zero,
MouseButton = ImGuiMouseButton.Left
})) }))
{ {
try try
{ {
Process.Start(new ProcessStartInfo Process.Start(new ProcessStartInfo
{ {
FileName = "http://patreon.com/lizac", FileName = "https://www.patreon.com/lizac",
UseShellExecute = true, UseShellExecute = true,
Verb = string.Empty, Verb = string.Empty,
}); });

6
packages.lock.json Normal file
View File

@ -0,0 +1,6 @@
{
"version": 1,
"dependencies": {
"net7.0-windows7.0": {}
}
}