From 1e614eb94467d04783851ae014d43cb3c1f6ff3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 6 Jul 2025 14:14:39 +0200 Subject: [PATCH] Asset Browser: Handle navigation hotkeys only when directory is hovered --- .../src/EditWindows/ContentBrowserWindow.bf | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf index fec1669..743d805 100644 --- a/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf +++ b/GlitchyEditor/src/EditWindows/ContentBrowserWindow.bf @@ -689,35 +689,39 @@ namespace GlitchyEditor.EditWindows /// Renders the contents of _currentDirectory. Returns the node of the current directory, or null if the browser isn't in a directory. private void DrawCurrentDirectory(TreeNode currentDirectoryNode) { - // TODO: Yes we really have to come up with a good system for hotkeys... - var currentDirectoryNode; - if (Input.IsKeyPressed(.Alt)) + if (ImGui.IsWindowHovered()) { - if (Input.IsKeyPressing(.Up)) + // TODO: Come up with a good hotkey system... + var currentDirectoryNode; + if (Input.IsKeyPressed(.Alt)) { - NavigateUp(); + if (Input.IsKeyPressing(.Up)) + { + NavigateUp(); + } + + if (Input.IsKeyPressing(.Left)) + { + NavigateBack(); + } + + if (Input .IsKeyPressing(.Right)) + { + NavigateForward(); + } } - if (Input.IsKeyPressing(.Left)) + if (Input.IsMouseButtonPressing(.XButton1)) { NavigateBack(); } - if (Input .IsKeyPressing(.Right)) + if (Input.IsMouseButtonPressing(.XButton2)) { NavigateForward(); } } - if (Input.IsMouseButtonPressing(.XButton1)) - { - NavigateForward(); - } - if (Input.IsMouseButtonPressing(.XButton2)) - { - NavigateBack(); - } - List> directoryEntries = null; StringView searchFilter = StringView(&_filesFilter);