1
0
forked from liza/Deliveroo

Move config button to titlebar

This commit is contained in:
Liza 2023-11-11 02:36:47 +01:00
parent 5b0bcd981b
commit 92db028e01
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

@ -24,7 +24,6 @@ internal sealed class TurnInWindow : LImGui.LWindow
private readonly Configuration _configuration; private readonly Configuration _configuration;
private readonly ICondition _condition; private readonly ICondition _condition;
private readonly GcRewardsCache _gcRewardsCache; private readonly GcRewardsCache _gcRewardsCache;
private readonly ConfigWindow _configWindow;
public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration, public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration,
ICondition condition, GcRewardsCache gcRewardsCache, ConfigWindow configWindow) ICondition condition, GcRewardsCache gcRewardsCache, ConfigWindow configWindow)
@ -35,7 +34,6 @@ internal sealed class TurnInWindow : LImGui.LWindow
_configuration = configuration; _configuration = configuration;
_condition = condition; _condition = condition;
_gcRewardsCache = gcRewardsCache; _gcRewardsCache = gcRewardsCache;
_configWindow = configWindow;
Position = new Vector2(100, 100); Position = new Vector2(100, 100);
PositionCondition = ImGuiCond.FirstUseEver; PositionCondition = ImGuiCond.FirstUseEver;
@ -49,6 +47,20 @@ internal sealed class TurnInWindow : LImGui.LWindow
Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse; Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse;
ShowCloseButton = false; ShowCloseButton = false;
AllowClickthrough = 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; } public bool State { get; set; }
@ -117,10 +129,6 @@ internal sealed class TurnInWindow : LImGui.LWindow
State = state; State = state;
} }
ImGui.SameLine();
if (ImGuiComponents.IconButton("###OpenConfig", FontAwesomeIcon.Cog))
_configWindow.IsOpen = true;
ImGui.Indent(27); ImGui.Indent(27);
if (!string.IsNullOrEmpty(Error)) if (!string.IsNullOrEmpty(Error))
{ {