mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-16 05:34:16 +01:00
Fix log window layout (#1706)
* Fix log window layout Fixed custom line rendering from not advancing ImGui cursor, and move input boxes around as log window is resized to become narower. * Undo unused change
This commit is contained in:
parent
cf4a9e3055
commit
4c18f77f51
1 changed files with 23 additions and 10 deletions
|
|
@ -90,11 +90,6 @@ internal class ConsoleWindow : Window, IDisposable
|
||||||
this.Size = new Vector2(500, 400);
|
this.Size = new Vector2(500, 400);
|
||||||
this.SizeCondition = ImGuiCond.FirstUseEver;
|
this.SizeCondition = ImGuiCond.FirstUseEver;
|
||||||
|
|
||||||
this.SizeConstraints = new WindowSizeConstraints
|
|
||||||
{
|
|
||||||
MinimumSize = new Vector2(600.0f, 200.0f),
|
|
||||||
};
|
|
||||||
|
|
||||||
this.RespectCloseHotkey = false;
|
this.RespectCloseHotkey = false;
|
||||||
|
|
||||||
this.logLinesLimit = configuration.LogLinesLimit;
|
this.logLinesLimit = configuration.LogLinesLimit;
|
||||||
|
|
@ -555,10 +550,24 @@ internal class ConsoleWindow : Window, IDisposable
|
||||||
if (ImGui.IsItemHovered()) ImGui.SetTooltip("Kill game");
|
if (ImGui.IsItemHovered()) ImGui.SetTooltip("Kill game");
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGui.SetCursorPosX(
|
|
||||||
ImGui.GetContentRegionMax().X - (2 * 200.0f * ImGuiHelpers.GlobalScale) - ImGui.GetStyle().ItemSpacing.X);
|
|
||||||
|
|
||||||
ImGui.PushItemWidth(200.0f * ImGuiHelpers.GlobalScale);
|
var inputWidth = 200.0f * ImGuiHelpers.GlobalScale;
|
||||||
|
var nextCursorPosX = ImGui.GetContentRegionMax().X - (2 * inputWidth) - ImGui.GetStyle().ItemSpacing.X;
|
||||||
|
var breakInputLines = nextCursorPosX < 0;
|
||||||
|
if (ImGui.GetCursorPosX() > nextCursorPosX)
|
||||||
|
{
|
||||||
|
ImGui.NewLine();
|
||||||
|
inputWidth = ImGui.GetWindowWidth() - (ImGui.GetStyle().WindowPadding.X * 2);
|
||||||
|
|
||||||
|
if (!breakInputLines)
|
||||||
|
inputWidth = (inputWidth - ImGui.GetStyle().ItemSpacing.X) / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImGui.SetCursorPosX(nextCursorPosX);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.PushItemWidth(inputWidth);
|
||||||
if (ImGui.InputTextWithHint(
|
if (ImGui.InputTextWithHint(
|
||||||
"##textHighlight",
|
"##textHighlight",
|
||||||
"regex highlight",
|
"regex highlight",
|
||||||
|
|
@ -583,8 +592,10 @@ internal class ConsoleWindow : Window, IDisposable
|
||||||
log.HighlightMatches = null;
|
log.HighlightMatches = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
if (!breakInputLines)
|
||||||
ImGui.PushItemWidth(200.0f * ImGuiHelpers.GlobalScale);
|
ImGui.SameLine();
|
||||||
|
|
||||||
|
ImGui.PushItemWidth(inputWidth);
|
||||||
if (ImGui.InputTextWithHint(
|
if (ImGui.InputTextWithHint(
|
||||||
"##textFilter",
|
"##textFilter",
|
||||||
"regex global filter",
|
"regex global filter",
|
||||||
|
|
@ -1082,6 +1093,8 @@ internal class ConsoleWindow : Window, IDisposable
|
||||||
lastc = currc;
|
lastc = currc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Dummy(screenPos - ImGui.GetCursorScreenPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
private record LogEntry
|
private record LogEntry
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue