Add middle and right mouse button actions to asset/object pickers to clear value or show popup quickly

This commit is contained in:
2026-08-29 23:46:54 +02:00
parent d890901ee6
commit ab7936c9ff
2 changed files with 29 additions and 0 deletions
@@ -322,7 +322,11 @@ namespace FlaxEditor.CustomEditors.Editors
// Deselect
if (_value != null && button1Rect.Contains(ref location))
{
Focus();
Value = null;
return true;
}
// Picker dropdown menu
if (_supportsPickDropDown && (isSelected ? button2Rect : button1Rect).Contains(ref location))
@@ -372,6 +376,18 @@ namespace FlaxEditor.CustomEditors.Editors
if (_hasValidDragOver)
_hasValidDragOver = false;
}
if (button == MouseButton.Middle)
{
// Clear value
Focus();
Value = null;
return true;
}
if (button == MouseButton.Right && _supportsPickDropDown)
{
// Show picker
ShowDropDownMenu();
}
return base.OnMouseUp(location, button);
}
+13
View File
@@ -299,6 +299,7 @@ namespace FlaxEditor.GUI
}
else if (Button1Rect.Contains(location))
{
// Show picker
Focus();
OnSubmit();
}
@@ -318,6 +319,18 @@ namespace FlaxEditor.GUI
}
}
}
if (button == MouseButton.Middle && IconRect.Contains(ref location))
{
// Clear value
Focus();
Validator.SelectedItem = null;
}
if (button == MouseButton.Right && IconRect.Contains(ref location))
{
// Show picker
Focus();
OnSubmit();
}
// Handled
return true;