diff --git a/ChatTwo/Configuration.cs b/ChatTwo/Configuration.cs
index 7fbe619..fe46f43 100755
--- a/ChatTwo/Configuration.cs
+++ b/ChatTwo/Configuration.cs
@@ -247,6 +247,7 @@ internal enum PreviewPosition
Inside,
Top,
Bottom,
+ Tooltip,
}
internal static class PreviewPositionExt
@@ -257,6 +258,7 @@ internal static class PreviewPositionExt
PreviewPosition.Inside => Language.Options_Preview_Inside,
PreviewPosition.Top => Language.Options_Preview_Top,
PreviewPosition.Bottom => Language.Options_Preview_Bottom,
+ PreviewPosition.Tooltip => Language.Options_Preview_Tooltip,
_ => throw new ArgumentOutOfRangeException(nameof(position), position, null),
};
}
diff --git a/ChatTwo/Resources/Language.Designer.cs b/ChatTwo/Resources/Language.Designer.cs
index 95f9f51..8e9b190 100755
--- a/ChatTwo/Resources/Language.Designer.cs
+++ b/ChatTwo/Resources/Language.Designer.cs
@@ -2444,6 +2444,15 @@ namespace ChatTwo.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to Tooltip.
+ ///
+ internal static string Options_Preview_Tooltip {
+ get {
+ return ResourceManager.GetString("Options_Preview_Tooltip", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Top.
///
diff --git a/ChatTwo/Resources/Language.resx b/ChatTwo/Resources/Language.resx
index f3e7052..a9ce015 100644
--- a/ChatTwo/Resources/Language.resx
+++ b/ChatTwo/Resources/Language.resx
@@ -1072,4 +1072,7 @@
Text Preview:
+
+ Tooltip
+
diff --git a/ChatTwo/Ui/ChatLogWindow.cs b/ChatTwo/Ui/ChatLogWindow.cs
index 3c05f73..96e5cbe 100644
--- a/ChatTwo/Ui/ChatLogWindow.cs
+++ b/ChatTwo/Ui/ChatLogWindow.cs
@@ -517,8 +517,7 @@ public sealed class ChatLogWindow : Window
LastViewport = ImGui.GetWindowViewport().NativePtr;
WasDocked = ImGui.IsWindowDocked();
- var drawPreview = Plugin.Config.PreviewPosition is PreviewPosition.Inside;
- if (drawPreview)
+ if (Plugin.Config.PreviewPosition is PreviewPosition.Inside or PreviewPosition.Tooltip)
Plugin.InputPreview.CalculatePreview();
var currentTab = Plugin.Config.SidebarTabView ? DrawTabSidebar() : DrawTabBar();
@@ -527,7 +526,7 @@ public sealed class ChatLogWindow : Window
if (currentTab > -1 && currentTab < Plugin.Config.Tabs.Count)
activeTab = Plugin.Config.Tabs[currentTab];
- if (drawPreview)
+ if (Plugin.Config.PreviewPosition is PreviewPosition.Inside)
Plugin.InputPreview.DrawPreview();
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero))
@@ -702,6 +701,14 @@ public sealed class ChatLogWindow : Window
ImGui.InputTextWithHint("##chat2-input", isChatEnabled ? "": Language.ChatLog_DisabledInput, ref Chat, 500, flags, Callback);
}
+ if (Plugin.Config.PreviewPosition is PreviewPosition.Tooltip && !string.IsNullOrEmpty(Chat) && ImGui.IsItemHovered())
+ {
+ ImGui.SetNextWindowSize(new Vector2(500 * ImGuiHelpers.GlobalScale, -1));
+ using var tooltip = ImRaii.Tooltip();
+ if (tooltip)
+ Plugin.InputPreview.DrawPreview();
+ }
+
if (ImGui.IsItemDeactivated())
{
if (ImGui.IsKeyDown(ImGuiKey.Escape))