feat: add close button to chat log

This commit is contained in:
Dean Sheather
2024-07-08 16:57:37 +10:00
parent ec67364360
commit fef9122eca
6 changed files with 46 additions and 4 deletions
+10 -2
View File
@@ -662,7 +662,8 @@ public sealed class ChatLogWindow : Window
var buttonWidth = afterIcon.X - beforeIcon.X;
var showNovice = Plugin.Config.ShowNoviceNetwork && GameFunctions.GameFunctions.IsMentor();
var inputWidth = ImGui.GetContentRegionAvail().X - buttonWidth * (showNovice ? 2 : 1);
var buttonsRight = (showNovice ? 1 : 0) + (Plugin.Config.ShowCloseButton ? 1 : 0);
var inputWidth = ImGui.GetContentRegionAvail().X - buttonWidth * (1 + buttonsRight);
var inputType = TempChannel?.ToChatType() ?? activeTab?.Channel?.ToChatType() ?? Plugin.Functions.Chat.Channel.Channel.ToChatType();
var isCommand = Chat.Trim().StartsWith('/');
@@ -774,9 +775,16 @@ public sealed class ChatLogWindow : Window
ImGui.SameLine();
if (ImGuiUtil.IconButton(FontAwesomeIcon.Cog))
if (ImGuiUtil.IconButton(FontAwesomeIcon.Cog, width: (int)buttonWidth))
Plugin.SettingsWindow.Toggle();
if (Plugin.Config.ShowCloseButton)
{
ImGui.SameLine();
if (ImGuiUtil.IconButton(FontAwesomeIcon.Times, width: (int)buttonWidth))
UserHide();
}
if (!showNovice)
return;
+3
View File
@@ -35,6 +35,9 @@ internal sealed class ChatLog : ISettingsTab
ImGuiUtil.OptionCheckbox(ref Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description);
ImGui.Spacing();
ImGuiUtil.OptionCheckbox(ref Mutable.ShowCloseButton, Language.Options_ShowCloseButton_Name, Language.Options_ShowCloseButton_Description);
ImGui.Spacing();
ImGuiUtil.OptionCheckbox(ref Mutable.NativeItemTooltips, Language.Options_NativeItemTooltips_Name, string.Format(Language.Options_NativeItemTooltips_Description, Plugin.PluginName));
ImGui.Spacing();