Asset Browser: Handle navigation hotkeys only when directory is hovered

This commit is contained in:
Simon Lübeß
2025-07-06 14:14:39 +02:00
parent 1c97a5e9c4
commit 1e614eb944
@@ -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. /// 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<AssetNode> currentDirectoryNode) private void DrawCurrentDirectory(TreeNode<AssetNode> currentDirectoryNode)
{ {
// TODO: Yes we really have to come up with a good system for hotkeys... if (ImGui.IsWindowHovered())
var currentDirectoryNode;
if (Input.IsKeyPressed(.Alt))
{ {
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(); NavigateBack();
} }
if (Input .IsKeyPressing(.Right)) if (Input.IsMouseButtonPressing(.XButton2))
{ {
NavigateForward(); NavigateForward();
} }
} }
if (Input.IsMouseButtonPressing(.XButton1))
{
NavigateForward();
}
if (Input.IsMouseButtonPressing(.XButton2))
{
NavigateBack();
}
List<TreeNode<AssetNode>> directoryEntries = null; List<TreeNode<AssetNode>> directoryEntries = null;
StringView searchFilter = StringView(&_filesFilter); StringView searchFilter = StringView(&_filesFilter);