diff --git a/FModel/Extensions/ImGuiExtensions.cs b/FModel/Extensions/ImGuiExtensions.cs index f317e889..c6ab3b33 100644 --- a/FModel/Extensions/ImGuiExtensions.cs +++ b/FModel/Extensions/ImGuiExtensions.cs @@ -23,30 +23,29 @@ public static class ImGuiExtensions ImGui.SetNextWindowPos(new Vector2(0, 0)); ImGui.SetNextWindowSize(new Vector2(size.X, size.Y)); ImGui.Begin("Snooper", flags); - ImGui.DockSpace(ImGui.GetID("Snooper")); + ImGui.DockSpace(0); } public static void DrawNavbar() { - if (ImGui.BeginMainMenuBar()) + if (!ImGui.BeginMainMenuBar()) return; + + if (ImGui.BeginMenu("Edit")) { - if (ImGui.BeginMenu("Edit")) - { - if (ImGui.MenuItem("Undo", "CTRL+Z")) {} - if (ImGui.MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item - ImGui.Separator(); - if (ImGui.MenuItem("Cut", "CTRL+X")) {} - if (ImGui.MenuItem("Copy", "CTRL+C")) {} - if (ImGui.MenuItem("Paste", "CTRL+V")) {} - ImGui.EndMenu(); - } - - const string text = "Press ESC to Exit..."; - ImGui.SetCursorPosX(ImGui.GetWindowViewport().WorkSize.X - ImGui.CalcTextSize(text).X - 5); - ImGui.TextColored(new Vector4(0.36f, 0.42f, 0.47f, 1.00f), text); // ImGuiCol.TextDisabled - - ImGui.EndMainMenuBar(); + if (ImGui.MenuItem("Undo", "CTRL+Z")) {} + if (ImGui.MenuItem("Redo", "CTRL+Y", false, false)) {} // Disabled item + ImGui.Separator(); + if (ImGui.MenuItem("Cut", "CTRL+X")) {} + if (ImGui.MenuItem("Copy", "CTRL+C")) {} + if (ImGui.MenuItem("Paste", "CTRL+V")) {} + ImGui.EndMenu(); } + + const string text = "Press ESC to Exit..."; + ImGui.SetCursorPosX(ImGui.GetWindowViewport().WorkSize.X - ImGui.CalcTextSize(text).X - 5); + ImGui.TextColored(new Vector4(0.36f, 0.42f, 0.47f, 1.00f), text); // ImGuiCol.TextDisabled + + ImGui.EndMainMenuBar(); } public static void DrawFPS() diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index 1292021c..f1d0bef9 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -140,7 +140,7 @@ namespace FModel.Settings set => SetProperty(ref _isLoggerExpanded, value); } - private GridLength _avalonImageSize = GridLength.Auto; + private GridLength _avalonImageSize = new (200, GridUnitType.Pixel); public GridLength AvalonImageSize { get => _avalonImageSize; diff --git a/FModel/Views/Snooper/Snooper.cs b/FModel/Views/Snooper/Snooper.cs index 7eb351d1..0b7cf1d6 100644 --- a/FModel/Views/Snooper/Snooper.cs +++ b/FModel/Views/Snooper/Snooper.cs @@ -127,7 +127,10 @@ public class Snooper _gl = GL.GetApi(_window); _gl.Enable(EnableCap.Multisample); - _controller = new ImGuiController(_gl, _window, input); + // we don't need to bother with file check + // but keep an eye on font size for different monitors + var fontConfig = new ImGuiFontConfig("C:\\Windows\\Fonts\\segoeui.ttf", 16); + _controller = new ImGuiController(_gl, _window, input, fontConfig); ImGuiExtensions.Theme(); @@ -205,6 +208,7 @@ public class Snooper private void OnUpdate(double deltaTime) { + if (ImGui.GetIO().WantTextInput) return; var multiplier = _keyboard.IsKeyPressed(Key.ShiftLeft) ? 2f : 1f; var moveSpeed = _camera.Speed * multiplier * (float) deltaTime; if (_keyboard.IsKeyPressed(Key.W))