1
0
Fork 0

Move config button to titlebar

master
Liza 2023-11-11 02:36:47 +01:00
parent 5b0bcd981b
commit 92db028e01
Signed by: liza
GPG Key ID: 7199F8D727D55F67
1 changed files with 14 additions and 6 deletions

View File

@ -24,7 +24,6 @@ internal sealed class TurnInWindow : LImGui.LWindow
private readonly Configuration _configuration;
private readonly ICondition _condition;
private readonly GcRewardsCache _gcRewardsCache;
private readonly ConfigWindow _configWindow;
public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration,
ICondition condition, GcRewardsCache gcRewardsCache, ConfigWindow configWindow)
@ -35,7 +34,6 @@ internal sealed class TurnInWindow : LImGui.LWindow
_configuration = configuration;
_condition = condition;
_gcRewardsCache = gcRewardsCache;
_configWindow = configWindow;
Position = new Vector2(100, 100);
PositionCondition = ImGuiCond.FirstUseEver;
@ -49,6 +47,20 @@ internal sealed class TurnInWindow : LImGui.LWindow
Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse;
ShowCloseButton = false;
AllowClickthrough = false;
TitleBarButtons.Add(new TitleBarButton
{
Icon = FontAwesomeIcon.Cog,
IconOffset = new Vector2(1.5f, 1),
Click = _ => configWindow.IsOpen = true,
Priority = int.MinValue,
ShowTooltip = () =>
{
ImGui.BeginTooltip();
ImGui.Text("Open Configuration");
ImGui.EndTooltip();
}
});
}
public bool State { get; set; }
@ -117,10 +129,6 @@ internal sealed class TurnInWindow : LImGui.LWindow
State = state;
}
ImGui.SameLine();
if (ImGuiComponents.IconButton("###OpenConfig", FontAwesomeIcon.Cog))
_configWindow.IsOpen = true;
ImGui.Indent(27);
if (!string.IsNullOrEmpty(Error))
{