fix(input-preview): wire Inside-mode + Tooltip-mode render paths
InputPreview was only rendered for PreviewPosition.Top/Bottom (the DrawConditions IsWindowMode gate). Inside-mode (the default) and Tooltip-mode had no caller at all because v1.5.6's inline-render path lived on the deleted ChatLogWindow and was not migrated to the v1.7.0 Components-Layer. Wire Inside-mode by calling CalculatePreviewHeight + DrawPreview inline from MainWindow.DrawMainArea between the message-list child and the input bar, with the message-list height reserved for the preview block. Wire Tooltip-mode by sampling IsItemHovered() on the input text widget inside InputBar.DrawInputField (analog to the existing _isFocused = ImGui.IsItemFocused() idiom on the same line) and exposing it as WasInputTextHovered; MainWindow opens the tooltip after _input.Draw when both the hover-flag and PreviewPosition.Tooltip are active. Plan-drift acknowledged: the plan stated Plugin.InputPreview is statically reachable, but the property was declared as an instance member on Plugin.cs:101. Hoisted to internal static to match the plan's intention (analog to Plugin.Config); updated the single external instance-access site in PluginLifecycle.RegisterWindows to the type-qualified form. Verified in-game: Inside-mode preview block appears between message list and input bar on first keystroke; tooltip-mode shows preview on text-field hover only; Top/Bottom-mode unchanged; empty buffer hides the preview in all modes. dotnet build clean, dotnet csharpier check clean.
This commit is contained in:
@@ -141,7 +141,7 @@ internal sealed class InputPreview : Window
|
||||
DrawPreview();
|
||||
}
|
||||
|
||||
private void CalculatePreviewHeight()
|
||||
internal void CalculatePreviewHeight()
|
||||
{
|
||||
// Pre-draw offscreen once to measure actual rendered height; value is
|
||||
// consumed next frame by PreDraw() for window sizing.
|
||||
@@ -162,7 +162,7 @@ internal sealed class InputPreview : Window
|
||||
PreviewHeight += IsWindowMode ? ImGui.GetStyle().WindowPadding.Y * 2 : 0;
|
||||
}
|
||||
|
||||
private void DrawPreview()
|
||||
internal void DrawPreview()
|
||||
{
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, Vector2.Zero))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user