- Added the ability to rename selected visject comments by pressing F2
- Added rename option to context menu for visject comments
This commit is contained in:
@@ -172,10 +172,21 @@ namespace FlaxEditor.Surface
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Update(float deltaTime)
|
public override void Update(float deltaTime)
|
||||||
{
|
{
|
||||||
if (_isRenaming && (!_renameTextBox.IsFocused || !RootWindow.IsFocused))
|
if (_isRenaming)
|
||||||
{
|
{
|
||||||
Rename(_renameTextBox.Text);
|
// Stop renaming when clicking anywhere else
|
||||||
StopRenaming();
|
if (!_renameTextBox.IsFocused || !RootWindow.IsFocused)
|
||||||
|
{
|
||||||
|
Rename(_renameTextBox.Text);
|
||||||
|
StopRenaming();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (IsSelected && Input.GetKeyDown(KeyboardKeys.F2))
|
||||||
|
{
|
||||||
|
StartRenaming();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Update(deltaTime);
|
base.Update(deltaTime);
|
||||||
@@ -417,6 +428,12 @@ namespace FlaxEditor.Surface
|
|||||||
base.OnShowSecondaryContextMenu(menu, location);
|
base.OnShowSecondaryContextMenu(menu, location);
|
||||||
|
|
||||||
menu.AddSeparator();
|
menu.AddSeparator();
|
||||||
|
menu.AddButton("Rename", () =>
|
||||||
|
{
|
||||||
|
if(!_isRenaming)
|
||||||
|
StartRenaming();
|
||||||
|
});
|
||||||
|
|
||||||
ContextMenuChildMenu cmOrder = menu.AddChildMenu("Order");
|
ContextMenuChildMenu cmOrder = menu.AddChildMenu("Order");
|
||||||
{
|
{
|
||||||
cmOrder.ContextMenu.AddButton("Bring Forward", () =>
|
cmOrder.ContextMenu.AddButton("Bring Forward", () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user