fix: hidpi fixes for changelog and console windows (#1459)

This commit is contained in:
Ava Chaney 2023-10-04 11:00:58 -07:00 committed by GitHub
parent 90605be611
commit a3eb270506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -175,7 +175,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
ImGui.Dummy(new Vector2(dummySize));
ImGui.SameLine();
var logoContainerSize = new Vector2(this.Size!.Value.X * 0.2f - dummySize, this.Size!.Value.Y);
var logoContainerSize = new Vector2(windowSize.X * 0.2f - dummySize, windowSize.Y);
using (var child = ImRaii.Child("###logoContainer", logoContainerSize, false))
{
if (!child)
@ -196,7 +196,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
ImGui.Dummy(new Vector2(dummySize));
ImGui.SameLine();
using (var child = ImRaii.Child("###textContainer", new Vector2((this.Size!.Value.X * 0.8f) - dummySize * 4, this.Size!.Value.Y), false))
using (var child = ImRaii.Child("###textContainer", new Vector2((windowSize.X * 0.8f) - dummySize * 4, windowSize.Y), false))
{
if (!child)
return;
@ -351,7 +351,7 @@ internal sealed class ChangelogWindow : Window, IDisposable
var childSize = ImGui.GetWindowSize();
var closeButtonSize = 15 * ImGuiHelpers.GlobalScale;
ImGui.SetCursorPos(new Vector2(childSize.X - closeButtonSize - (5 * ImGuiHelpers.GlobalScale), 10 * ImGuiHelpers.GlobalScale));
ImGui.SetCursorPos(new Vector2(childSize.X - closeButtonSize - 5, 10 * ImGuiHelpers.GlobalScale));
if (ImGuiComponents.IconButton(FontAwesomeIcon.Times))
{
Dismiss();
@ -360,9 +360,11 @@ internal sealed class ChangelogWindow : Window, IDisposable
ImGui.PopStyleColor(2);
ImGui.PopStyleVar();
if (ImGui.IsItemHovered())
{
ImGui.SetTooltip("I don't care about this");
}
}
}

View file

@ -145,7 +145,7 @@ internal class ConsoleWindow : Window, IDisposable
this.DrawFilterToolbar();
ImGui.BeginChild("scrolling", new Vector2(0, ImGui.GetFrameHeightWithSpacing() - 55), false, ImGuiWindowFlags.AlwaysHorizontalScrollbar | ImGuiWindowFlags.AlwaysVerticalScrollbar);
ImGui.BeginChild("scrolling", new Vector2(0, ImGui.GetFrameHeightWithSpacing() - 55 * ImGuiHelpers.GlobalScale), false, ImGuiWindowFlags.AlwaysHorizontalScrollbar | ImGuiWindowFlags.AlwaysVerticalScrollbar);
if (this.clearLog) this.Clear();
@ -268,11 +268,9 @@ internal class ConsoleWindow : Window, IDisposable
}
ImGui.SetItemDefaultFocus();
if (getFocus)
ImGui.SetKeyboardFocusHere(-1); // Auto focus previous widget
if (getFocus) ImGui.SetKeyboardFocusHere(-1); // Auto focus previous widget
if (hadColor)
ImGui.PopStyleColor();
if (hadColor) ImGui.PopStyleColor();
if (ImGui.Button("Send", ImGuiHelpers.ScaledVector2(80.0f, 23.0f)))
{